diff options
author | Zuul <zuul@review.opendev.org> | 2021-10-13 01:11:03 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2021-10-13 01:11:03 +0000 |
commit | 3f5d5b0252b3690af1e6577bf6584efe506f15fe (patch) | |
tree | f26006d17983d5823eda6bc8909a4ab59c39b4a1 /test/unit/test_shell.py | |
parent | ec6a346afbf93374b132c93f6d114d58999998de (diff) | |
parent | ad3e8e49d072d8137c85c451db427d07e1301799 (diff) | |
download | python-swiftclient-3f5d5b0252b3690af1e6577bf6584efe506f15fe.tar.gz |
Merge "Include storage policy when listing account with --long"3.13.0
Diffstat (limited to 'test/unit/test_shell.py')
-rw-r--r-- | test/unit/test_shell.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/unit/test_shell.py b/test/unit/test_shell.py index e3c0bc7..295c918 100644 --- a/test/unit/test_shell.py +++ b/test/unit/test_shell.py @@ -466,6 +466,10 @@ class TestShell(unittest.TestCase): [None, [{'name': 'container', 'bytes': 0, 'count': 0}]], [None, []], ] + connection.return_value.head_container.return_value = { + 'x-timestamp': '1617393213.49752', + 'x-storage-policy': 'some-policy', + } argv = ["", "list", "--lh"] with CaptureOutput() as output: @@ -474,10 +478,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 2021-04-02 19:53:33 some-policy container\n' + ' 0 0\n') # Now test again, this time without returning metadata connection.return_value.head_container.return_value = {} @@ -495,10 +499,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 |