summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-07-25 15:09:49 +0800
committerTang Chen <chen.tang@easystack.cn>2016-07-25 15:09:49 +0800
commitbcaa5c2e0ea7d2f6390aba1debbe026c1599a0b2 (patch)
tree7b565b20e549f5fd44fe29ecdd5e6ccf1d5e03e5
parenta8880e8b34c1a0609a7b1c8f54de1f0199969a1c (diff)
downloadpython-openstackclient-bcaa5c2e0ea7d2f6390aba1debbe026c1599a0b2.tar.gz
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
-rw-r--r--openstackclient/tests/common/test_parseractions.py2
-rw-r--r--openstackclient/tests/compute/v2/test_server.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/openstackclient/tests/common/test_parseractions.py b/openstackclient/tests/common/test_parseractions.py
index 60d4a8cf..3038701f 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 9c89c6af..e487d57c 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)