Revision d8c7cccc kamaki/clients/image/test.py

b/kamaki/clients/image/test.py
243 243
        get.assert_called_once_with('/images/%s/members' % imgid, success=200)
244 244
        self.assertEqual(r, members)
245 245

  
246
    @patch('%s.perform_request' % khttp, return_value=FR())
247
    def test_add_member(self, PR):
248
        img0 = example_images_detailed[0]
246
    @patch('%s.put' % image_pkg, return_value=FR())
247
    def test_add_member(self, put):
248
        imgid = example_images_detailed[0]['id']
249 249
        new_member = 'us3r-15-n3w'
250
        self.assertRaises(
251
            ClientError,
252
            self.client.add_member,
253
            img0['id'], new_member)
254
        FR.status_code = 204
255
        self.client.add_member(img0['id'], new_member)
256
        self.assertEqual(self.client.http_client.url, self.url)
257
        self.assertEqual(
258
            self.client.http_client.path,
259
            '/images/%s/members/%s' % (img0['id'], new_member))
250
        self.client.add_member(imgid, new_member)
251
        put.assert_called_once_with(
252
            '/images/%s/members/%s' % (imgid, new_member),
253
            success=204)
260 254

  
261 255
    @patch('%s.perform_request' % khttp, return_value=FR())
262 256
    def test_remove_member(self, PR):

Also available in: Unified diff