Revision c701321b

b/kamaki/clients/test/cyclades.py
81 81
flavor_list = dict(flavors=dict(values=[
82 82
        dict(id=41, name="C1R1024D20"),
83 83
        dict(id=42, name="C1R1024D40"),
84
        dict(id=43, name="C1R1028D20")
85
    ]))
84
        dict(id=43, name="C1R1028D20")]))
85
img_list = dict(images=dict(values=[
86
    dict(name="maelstrom", id="0fb03e45-7d5a-4515-bd4e-e6bbf6457f06"),
87
    dict(name="edx_saas", id="1357163d-5fd8-488e-a117-48734c526206"),
88
    dict(name="Debian_Wheezy_Base", id="1f8454f0-8e3e-4b6c-ab8e-5236b728dffe"),
89
    dict(name="CentOS", id="21894b48-c805-4568-ac8b-7d4bb8eb533d"),
90
    dict(name="Ubuntu Desktop", id="37bc522c-c479-4085-bfb9-464f9b9e2e31"),
91
    dict(name="Ubuntu 12.10", id="3a24fef9-1a8c-47d1-8f11-e07bd5e544fd"),
92
    dict(name="Debian Base", id="40ace203-6254-4e17-a5cb-518d55418a7d"),
93
    dict(name="ubuntu_bundled", id="5336e265-5c7c-4127-95cb-2bf832a79903")]))
86 94

  
87 95

  
88 96
class Cyclades(TestCase):
......
314 322
                '/flavors/%s' % fid)
315 323
            self.assert_dicts_are_equal(r, flavor_list['flavors'])
316 324

  
325
    def test_list_images(self):
326
        self.FR.json = img_list
327
        with patch.object(self.C, 'perform_request', return_value=self.FR()):
328
            r = self.client.list_images()
329
            self.assertEqual(self.client.http_client.url, self.url)
330
            self.assertEqual(self.client.http_client.path, '/images')
331
            expected = img_list['images']['values']
332
            for i in range(len(r)):
333
                self.assert_dicts_are_equal(expected[i], r[i])
334
            self.client.list_images(detail=True)
335
            self.assertEqual(self.client.http_client.url, self.url)
336
            self.assertEqual(self.client.http_client.path, '/images/detail')
337

  
317 338
    """
318 339
    def test_list_images(self):
319 340
        r = self.client.list_images()

Also available in: Unified diff