Use assertIsNone(...) instead of assertEqual(None, ...)

Refer to:http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises

[H203] Use assertIs(Not)None to check for None (off by default) Unit
test assertions tend to give better messages for more specific assertions.
As a result, assertIsNone(...) is preferred over assertEqual(None, ...)
and assertIs(None, ...)

Change-Id: I4e60f3f7f3557080669b98cb48627acc40a72606
This commit is contained in:
chenaidong1
2016-12-08 14:56:39 +08:00
parent 2b9d1554cc
commit a9ebec4fbd
2 changed files with 2 additions and 2 deletions

View File

@@ -218,4 +218,4 @@ class KeystoneClientTest(utils.TestCase):
# authenticated
sess = auth_session.Session()
cl = client.Client(session=sess)
self.assertEqual(None, cl.service_catalog)
self.assertIsNone(cl.service_catalog)

View File

@@ -268,4 +268,4 @@ class KeystoneClientTest(utils.TestCase):
# authenticated
sess = auth_session.Session()
cl = client.Client(session=sess)
self.assertEqual(None, cl.service_catalog)
self.assertIsNone(cl.service_catalog)