diff options
Diffstat (limited to 'glanceclient/tests/unit/test_shell.py')
-rw-r--r-- | glanceclient/tests/unit/test_shell.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/glanceclient/tests/unit/test_shell.py b/glanceclient/tests/unit/test_shell.py index 898a9eb..0f15007 100644 --- a/glanceclient/tests/unit/test_shell.py +++ b/glanceclient/tests/unit/test_shell.py @@ -15,10 +15,7 @@ # under the License. import argparse -try: - from collections import OrderedDict -except ImportError: - from ordereddict import OrderedDict +from collections import OrderedDict import hashlib import logging import os @@ -802,10 +799,10 @@ class ShellCacheSchemaTest(testutils.TestCase): open.mock_calls[0]) self.assertEqual(mock.call(self.cache_files[1], 'w'), open.mock_calls[4]) - self.assertEqual(mock.call().write(json.dumps(schema_odict)), - open.mock_calls[2]) - self.assertEqual(mock.call().write(json.dumps(schema_odict)), - open.mock_calls[6]) + actual = json.loads(open.mock_calls[2][1][0]) + self.assertEqual(schema_odict, actual) + actual = json.loads(open.mock_calls[6][1][0]) + self.assertEqual(schema_odict, actual) @mock.patch('six.moves.builtins.open', new=mock.mock_open(), create=True) @mock.patch('os.path.exists', side_effect=[True, False, False, False]) @@ -825,10 +822,10 @@ class ShellCacheSchemaTest(testutils.TestCase): open.mock_calls[0]) self.assertEqual(mock.call(self.cache_files[1], 'w'), open.mock_calls[4]) - self.assertEqual(mock.call().write(json.dumps(schema_odict)), - open.mock_calls[2]) - self.assertEqual(mock.call().write(json.dumps(schema_odict)), - open.mock_calls[6]) + actual = json.loads(open.mock_calls[2][1][0]) + self.assertEqual(schema_odict, actual) + actual = json.loads(open.mock_calls[6][1][0]) + self.assertEqual(schema_odict, actual) @mock.patch('six.moves.builtins.open', new=mock.mock_open(), create=True) @mock.patch('os.path.exists', return_value=True) |