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, ...)

Change-Id: I8cbac0ae6eeddd8d12c2652acff16a370f2066bb
This commit is contained in:
melissaml 2016-10-22 17:29:26 +08:00
parent c82e388e83
commit 7874a8d103

View File

@ -110,7 +110,7 @@ def get_inventory(clean=True, extra_args=None):
class TestArgParser(unittest.TestCase):
def test_no_args(self):
arg_dict = dynamic_inventory.args([])
self.assertEqual(arg_dict['config'], None)
self.assertIsNone(arg_dict['config'])
self.assertEqual(arg_dict['list'], False)
def test_list_arg(self):