Skip to content

Commit bcaa5c2

Browse files
author
Tang Chen
committed
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
1 parent a8880e8 commit bcaa5c2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

openstackclient/tests/common/test_parseractions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_good_values(self):
4949
actual = getattr(results, 'property', {})
5050
# All should pass through unmolested
5151
expect = {'red': '', 'green': '100%', 'blue': '50%', 'format': '#rgb'}
52-
self.assertDictEqual(expect, actual)
52+
self.assertEqual(expect, actual)
5353

5454
def test_error_values(self):
5555
self.assertRaises(

openstackclient/tests/compute/v2/test_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,4 +1793,4 @@ def test_prep_server_detail(self, find_resource):
17931793
server_detail.pop('networks')
17941794

17951795
# Check the results.
1796-
self.assertDictEqual(info, server_detail)
1796+
self.assertEqual(info, server_detail)

0 commit comments

Comments
 (0)