Using assertIsNone() instead of assertEqual(None)

Following OpenStack Style Guidelines:
[1] http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises
[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)

Change-Id: I5b5900c509956cf13ec3d1f2105fc7c89531f22a
This commit is contained in:
lingyongxu 2017-06-07 09:07:59 +08:00
parent e11eb88ad9
commit 8d6eb36779

View File

@ -1713,7 +1713,7 @@ class TestAccountController(unittest.TestCase):
def test_serv_reserv(self):
# Test replication_server flag was set from configuration file.
conf = {'devices': self.testdir, 'mount_check': 'false'}
self.assertEqual(AccountController(conf).replication_server, None)
self.assertIsNone(AccountController(conf).replication_server)
for val in [True, '1', 'True', 'true']:
conf['replication_server'] = val
self.assertTrue(AccountController(conf).replication_server)