From bcaa5c2e0ea7d2f6390aba1debbe026c1599a0b2 Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Mon, 25 Jul 2016 15:09:49 +0800 Subject: [PATCH] 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 --- openstackclient/tests/common/test_parseractions.py | 2 +- openstackclient/tests/compute/v2/test_server.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openstackclient/tests/common/test_parseractions.py b/openstackclient/tests/common/test_parseractions.py index 60d4a8cfa2..3038701f50 100644 --- a/openstackclient/tests/common/test_parseractions.py +++ b/openstackclient/tests/common/test_parseractions.py @@ -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( diff --git a/openstackclient/tests/compute/v2/test_server.py b/openstackclient/tests/compute/v2/test_server.py index 9c89c6af7d..e487d57c5b 100644 --- a/openstackclient/tests/compute/v2/test_server.py +++ b/openstackclient/tests/compute/v2/test_server.py @@ -1793,4 +1793,4 @@ class TestServerGeneral(TestServer): server_detail.pop('networks') # Check the results. - self.assertDictEqual(info, server_detail) + self.assertEqual(info, server_detail)