Revision 5a745d8a kamaki/clients/image/test.py

b/kamaki/clients/image/test.py
234 234
            json=dict(memberships=[dict(member_id=m) for m in members]),
235 235
            success=204)
236 236

  
237
    @patch('%s.perform_request' % khttp, return_value=FR())
238
    def test_list_members(self, PR):
239
        img0 = example_images_detailed[0]
237
    @patch('%s.put' % image_pkg, return_value=FR())
238
    def test_list_members(self, get):
239
        imgid = example_images_detailed[0]['id']
240 240
        members = ['use3r-1d-0', 'us2r-1d-1', 'us3r-1d-2']
241 241
        FR.json = dict(members=members)
242
        r = self.client.list_members(img0['id'])
243
        self.assertEqual(self.client.http_client.url, self.url)
244
        self.assertEqual(
245
            self.client.http_client.path,
246
            '/images/%s/members' % img0['id'])
242
        r = self.client.list_members(imgid)
243
        get.assert_called_once_with('/images/%s/members' % imgid, success=200)
247 244
        self.assertEqual(r, members)
248 245

  
249 246
    @patch('%s.perform_request' % khttp, return_value=FR())

Also available in: Unified diff