Revision 5ffdab56
b/kamaki/clients/storage.py | ||
---|---|---|
319 | 319 |
self._assert_container() |
320 | 320 |
path = path4url(self.account, self.container) |
321 | 321 |
self.set_param('format', 'json') |
322 |
self.set_param('path', 'path_prefix')
|
|
322 |
self.set_param('path', path_prefix)
|
|
323 | 323 |
r = self.get(path, success=(200, 204, 404)) |
324 | 324 |
if r.status_code == 404: |
325 | 325 |
raise ClientError( |
b/kamaki/clients/test/pithos.py | ||
---|---|---|
523 | 523 |
self.assertEqual(self.client.list_objects(), []) |
524 | 524 |
self.FR.status_code = 404 |
525 | 525 |
self.assertRaises(ClientError, self.client.list_objects) |
526 |
|
|
527 |
def test_list_objects_in_path(self): |
|
528 |
self.FR.json = object_list |
|
529 |
path = '/some/awsome/path' |
|
530 |
acc = self.client.account |
|
531 |
cont = self.client.container |
|
532 |
PC.set_param = Mock() |
|
533 |
SP = PC.set_param |
|
534 |
with patch.object(PC, 'get', return_value=self.FR()) as get: |
|
535 |
self.client.list_objects_in_path(path) |
|
536 |
self.assertEqual(get.mock_calls, [ |
|
537 |
call('/%s/%s' % (acc, cont), success=(200, 204, 404))]) |
|
538 |
self.assertEqual(SP.mock_calls, [ |
|
539 |
call('format', 'json'), call('path', path)]) |
|
540 |
self.FR.status_code = 404 |
|
541 |
self.assertRaises(ClientError, self.client.list_objects) |
Also available in: Unified diff