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:
@@ -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"""
|
||||
|
@@ -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'}}]}
|
||||
|
Reference in New Issue
Block a user