Browse Source

Replace assertEqual(None, *) with assertIsNone in tests

Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.

Change-Id: I8faff65a87adde43373dc2c7874302cfb4d77e1f
Partial-bug:#1280522
tags/1.0.0
Swapnil Kulkarni (coolsvap) 3 years ago
parent
commit
7f65a2c104
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      refstack/tests/unit/test_api_utils.py
  2. 1
    1
      refstack/tests/unit/test_db.py

+ 1
- 1
refstack/tests/unit/test_api_utils.py View File

@@ -390,7 +390,7 @@ class APIUtilsTestCase(base.BaseTestCase):
390 390
             ('fake_test', const.USER): 'some_other_user',
391 391
             ('fake_test', const.SHARED_TEST_RUN): None,
392 392
         }.get(args)
393
-        self.assertEqual(None, api_utils.get_user_role('fake_test'))
393
+        self.assertIsNone(api_utils.get_user_role('fake_test'))
394 394
         self.assertRaises(exc.HTTPError, api_utils.enforce_permissions,
395 395
                           'fake_test', const.ROLE_USER)
396 396
         self.assertRaises(exc.HTTPError, api_utils.enforce_permissions,

+ 1
- 1
refstack/tests/unit/test_db.py View File

@@ -532,7 +532,7 @@ class DBBackendTestCase(base.BaseTestCase):
532 532
         # Test no key match.
533 533
         filtered.all.return_value = []
534 534
         result = api.get_pubkey(key)
535
-        self.assertEqual(None, result)
535
+        self.assertIsNone(result)
536 536
 
537 537
         session.query.assert_called_once_with(mock_model)
538 538
         query.filter_by.assert_called_once_with(md5_hash=khash)

Loading…
Cancel
Save