Use assertEqual() instead of assertDictEqual()

OpenStack now has dropped support for python 2.6 and lower.
So we don't need to define an assertDictEqual() for python
lower than 2.7.

Further, assertEqual() in testtools is able to handle dicts
comparation, just the same as assertDictEqual() in unittest2.
So we do't need to call assertDictEqual() for dicts any more.

Change-Id: I114bd434f9137844c25f0824be9b6ddee28ce7ee
This commit is contained in:
LiuNanke
2016-07-27 15:59:29 +08:00
parent 6b66e9914d
commit 3b530967de
2 changed files with 4 additions and 4 deletions

View File

@@ -769,7 +769,7 @@ This is a fake zip archive
processed_result = jsonutils.loads(result.body)
self.assertIn('id', processed_result.keys())
expected['id'] = processed_result['id']
self.assertDictEqual(expected, processed_result)
self.assertEqual(expected, processed_result)
def test_delete_category(self):
"""Check that category deleted successfully"""

View File

@@ -20,7 +20,7 @@ class TraverseHelperTests(base.MuranoTestCase):
def test_root_get_with_dict(self):
source = {'attr': True}
value = utils.TraverseHelper.get('/', source)
self.assertDictEqual(value, source)
self.assertEqual(value, source)
def test_root_get_with_list(self):
source = [{'attr': True}]
@@ -104,13 +104,13 @@ class TraverseHelperTests(base.MuranoTestCase):
source = {'attr1': False, 'attr2': True}
utils.TraverseHelper.remove('/attr1', source)
value = utils.TraverseHelper.get('/', source)
self.assertDictEqual(value, {'attr2': True})
self.assertEqual(value, {'attr2': True})
def test_nested_attribute_remove_from_dict(self):
source = {'obj': {'attr1': False, 'attr2': True}}
utils.TraverseHelper.remove('/obj/attr1', source)
value = utils.TraverseHelper.get('/obj', source)
self.assertDictEqual(value, {'attr2': True})
self.assertEqual(value, {'attr2': True})
def test_nested_attribute_remove_from_list_by_id(self):
source = {'obj': [{'?': {'id': 'id1'}}, {'?': {'id': 'id2'}}]}