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: Id90d1445053f295d36d52bf95794847ed524087d
This commit is contained in:
Tang Chen 2016-07-25 20:30:57 +08:00
parent 86e010cc83
commit e9bbca7ac7

View File

@ -443,7 +443,7 @@ class SessionAuthTests(utils.TestCase):
auth = AuthPlugin()
sess = client_session.Session(auth=auth)
resp = sess.get(self.TEST_URL)
self.assertDictEqual(resp.json(), self.TEST_JSON)
self.assertEqual(resp.json(), self.TEST_JSON)
self.assertRequestHeaderEqual('X-Auth-Token', AuthPlugin.TEST_TOKEN)
@ -453,7 +453,7 @@ class SessionAuthTests(utils.TestCase):
auth = AuthPlugin()
sess = client_session.Session(auth=auth)
resp = sess.get(self.TEST_URL, authenticated=False)
self.assertDictEqual(resp.json(), self.TEST_JSON)
self.assertEqual(resp.json(), self.TEST_JSON)
self.assertRequestHeaderEqual('X-Auth-Token', None)