Revision 0651cda3 kamaki/clients/cyclades/test.py

b/kamaki/clients/cyclades/test.py
171 171
            self.client.list_servers(changes_since=True)
172 172
            self.assertTrue(servers_get.call_args[1]['changes_since'])
173 173

  
174
    @patch('%s.images_get' % cyclades_pkg, return_value=FR())
175
    def test_get_image_metadata(self, IG):
176
        FR.json = dict(metadata=dict(values=img_recv['image']))
177
        r = self.client.get_image_metadata(img_ref)
178
        self.assertEqual(IG.call_args[0], ('%s' % img_ref, '/meta'))
179
        self.assert_dicts_are_equal(img_recv['image'], r)
180
        FR.json = dict(meta=img_recv['image'])
181
        key = 'somekey'
182
        self.client.get_image_metadata(img_ref, key)
183
        self.assertEqual(IG.call_args[0], ('%s' % img_ref, '/meta/%s' % key))
184

  
185 174
    @patch('%s.perform_request' % khttp, return_value=FR())
186 175
    def test_shutdown_server(self, PR):
187 176
        vm_id = vm_recv['server']['id']
......
407 396
            loads(data))
408 397

  
409 398
    @patch('%s.perform_request' % khttp, return_value=FR())
410
    def test_delete_server(self, PR):
411
        vm_id = vm_recv['server']['id']
412
        FR.status_code = 204
413
        self.client.delete_server(vm_id)
414
        self.assertEqual(self.client.http_client.url, self.url)
415
        self.assertEqual(self.client.http_client.path, '/servers/%s' % vm_id)
416

  
417
    @patch('%s.perform_request' % khttp, return_value=FR())
418 399
    def test_delete_image(self, PR):
419 400
        FR.status_code = 204
420 401
        self.client.delete_image(img_ref)

Also available in: Unified diff