diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/test_shell.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/test/unit/test_shell.py b/test/unit/test_shell.py index ef5d166..e3c0bc7 100644 --- a/test/unit/test_shell.py +++ b/test/unit/test_shell.py @@ -474,9 +474,10 @@ class TestShell(unittest.TestCase): mock.call(marker='container', prefix=None, headers={})] connection.return_value.get_account.assert_has_calls(calls) - self.assertEqual(output.out, - ' 0 0 1970-01-01 00:00:01 container\n' - ' 0 0\n') + self.assertEqual( + output.out, + ' 0 0 1970-01-01 00:00:01 container\n' + ' 0 0\n') # Now test again, this time without returning metadata connection.return_value.head_container.return_value = {} @@ -494,9 +495,10 @@ class TestShell(unittest.TestCase): mock.call(marker='container', prefix=None, headers={})] connection.return_value.get_account.assert_has_calls(calls) - self.assertEqual(output.out, - ' 0 0 ????-??-?? ??:??:?? container\n' - ' 0 0\n') + self.assertEqual( + output.out, + ' 0 0 ????-??-?? ??:??:?? container\n' + ' 0 0\n') def test_list_account_totals_error(self): # No --lh provided: expect info message about incorrect --totals use @@ -522,7 +524,7 @@ class TestShell(unittest.TestCase): swiftclient.shell.main(argv) calls = [mock.call(marker='', prefix=None, headers={})] connection.return_value.get_account.assert_has_calls(calls) - self.assertEqual(output.out, ' 6 3\n') + self.assertEqual(output.out, ' 6 3\n') @mock.patch('swiftclient.service.Connection') def test_list_container(self, connection): @@ -544,9 +546,12 @@ class TestShell(unittest.TestCase): self.assertEqual(output.out, 'object_a\n') - # Test container listing with --long + # Test container listing with --long and multiple pages connection.return_value.get_container.side_effect = [ - [None, [{'name': 'object_a', 'bytes': 0, + [None, [{'name': 'object_a', 'bytes': 3, + 'content_type': 'type/content', + 'last_modified': '123T456'}]], + [None, [{'name': 'object_b', 'bytes': 5, 'content_type': 'type/content', 'last_modified': '123T456'}]], [None, []], @@ -564,9 +569,11 @@ class TestShell(unittest.TestCase): connection.return_value.get_container.assert_has_calls(calls) self.assertEqual(output.out, - ' 0 123 456' + ' 3 123 456' ' type/content object_a\n' - ' 0\n') + ' 5 123 456' + ' type/content object_b\n' + ' 8\n') @mock.patch('swiftclient.service.Connection') def test_list_container_with_headers(self, connection): |