Revision 898e6fb7
b/kamaki/clients/test/pithos.py | ||
---|---|---|
442 | 442 |
self.client.copy_object(src_cont, src_obj, dst_cont, **kwargs) |
443 | 443 |
for k, v in kwargs.items(): |
444 | 444 |
self.assertEqual(v, put.mock_calls[-1][2][k]) |
445 |
|
|
446 |
def test_move_object(self): |
|
447 |
src_cont = 'src-c0nt41n3r' |
|
448 |
src_obj = 'src-0bj' |
|
449 |
dst_cont = 'dst-c0nt41n3r' |
|
450 |
dst_obj = 'dst-0bj' |
|
451 |
expected = call( |
|
452 |
src_obj, |
|
453 |
content_length=0, |
|
454 |
source_account=None, |
|
455 |
success=201, |
|
456 |
move_from='/%s/%s' % (src_cont, src_obj), |
|
457 |
delimiter=None, |
|
458 |
content_type=None, |
|
459 |
source_version=None, |
|
460 |
public=False) |
|
461 |
with patch.object(PC, 'object_put', return_value=self.FR()) as put: |
|
462 |
self.client.move_object(src_cont, src_obj, dst_cont) |
|
463 |
self.assertEqual(put.mock_calls[-1], expected) |
|
464 |
self.client.move_object(src_cont, src_obj, dst_cont, dst_obj) |
|
465 |
self.assertEqual(put.mock_calls[-1][1], (dst_obj,)) |
|
466 |
kwargs = dict( |
|
467 |
source_version='src-v3r510n', |
|
468 |
source_account='src-4cc0un7', |
|
469 |
public=True, |
|
470 |
content_type='c0n73n7Typ3', |
|
471 |
delimiter='5') |
|
472 |
self.client.move_object(src_cont, src_obj, dst_cont, **kwargs) |
|
473 |
for k, v in kwargs.items(): |
|
474 |
self.assertEqual(v, put.mock_calls[-1][2][k]) |
Also available in: Unified diff