Use assertEqual() instead of assertDictEqual()
In unittest2, assertDictEqual() is implemented by using != operator to compare two dicts. So is assertEqual() in testtools. assertEqual() in testtools is able to handle dict, list, set and so on. So we just call assertEqual() to make the unit tests simpler. Change-Id: Ice343b2ce468acae39d2ad79f7121503e3627656
This commit is contained in:
parent
a8880e8b34
commit
bcaa5c2e0e
@ -49,7 +49,7 @@ class TestKeyValueAction(utils.TestCase):
|
||||
actual = getattr(results, 'property', {})
|
||||
# All should pass through unmolested
|
||||
expect = {'red': '', 'green': '100%', 'blue': '50%', 'format': '#rgb'}
|
||||
self.assertDictEqual(expect, actual)
|
||||
self.assertEqual(expect, actual)
|
||||
|
||||
def test_error_values(self):
|
||||
self.assertRaises(
|
||||
|
@ -1793,4 +1793,4 @@ class TestServerGeneral(TestServer):
|
||||
server_detail.pop('networks')
|
||||
|
||||
# Check the results.
|
||||
self.assertDictEqual(info, server_detail)
|
||||
self.assertEqual(info, server_detail)
|
||||
|
Loading…
Reference in New Issue
Block a user