Using assertIsNone() instead of assertEqual(None)
TrivilalFix
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)
@@ -49,7 +49,7 @@ class TestContext(base.BaseTestCase):
self.assertEqual(ctx_dict['read_only'], False)
self.assertEqual(ctx_dict['show_deleted'], False)
self.assertEqual(ctx_dict['auth_token'], '_token_')
- self.assertEqual(ctx_dict['resource_uuid'], None)
+ self.assertIsNone(ctx_dict['resource_uuid'])
self.assertEqual(ctx_dict['user_name'], '_user_name_')
self.assertEqual(ctx_dict['roles'], ['admin', 'member'])
self.assertEqual(ctx_dict['auth_url'], 'fake_auth_url')
@@ -83,7 +83,7 @@ class TestContext(base.BaseTestCase):
self.assertEqual(ctx_dict['read_only'], False)
self.assertEqual(ctx_dict['show_deleted'], False)
self.assertEqual(ctx_dict['auth_token'], '_token_')
- self.assertEqual(ctx_dict['resource_uuid'], None)
+ self.assertIsNone(ctx_dict['resource_uuid'])
self.assertEqual(ctx_dict['user_name'], '_user_name_')
self.assertEqual(ctx_dict['roles'], ['admin', 'member'])
self.assertEqual(ctx_dict['auth_url'], 'fake_auth_url')
@@ -116,7 +116,7 @@ class TestContext(base.BaseTestCase):
self.assertEqual(ctx_dict['read_only'], False)
self.assertEqual(ctx_dict['show_deleted'], False)
self.assertEqual(ctx_dict['auth_token'], '_token_')
- self.assertEqual(ctx_dict['resource_uuid'], None)
+ self.assertIsNone(ctx_dict['resource_uuid'])
self.assertEqual(ctx_dict['user_name'], '_user_name_')
self.assertEqual(ctx_dict['roles'], ['admin', 'member'])
self.assertEqual(ctx_dict['auth_url'], 'fake_auth_url')
