Using assertIsNone() instead of assertIs(None)

Following OpenStack Style Guidelines[1]:
[H203] Unit test assertions tend to give better messages for more
specific assertions. As a result, assertIsNone(...) is preferred over
assertEqual(None, ...) and assertIs(..,None)

[1] http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises

Change-Id: I9b0cedae367798ce282b0229c135b3f4a72f353a
This commit is contained in:
Cao Xuan Hoang 2016-09-26 15:33:18 +07:00
parent cb2b548f6b
commit 09131e1362
1 changed files with 2 additions and 2 deletions

View File

@ -45,8 +45,8 @@ class ConfigTestCase(unit.TestCase):
wsgi.find_paste_config())
def test_config_default(self):
self.assertIs(None, CONF.auth.password)
self.assertIs(None, CONF.auth.token)
self.assertIsNone(CONF.auth.password)
self.assertIsNone(CONF.auth.token)
def test_profiler_config_default(self):
"""Check config.set_config_defaults() has set [profiler]enabled."""