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):
('fake_test', const.USER): 'some_other_user',
('fake_test', const.SHARED_TEST_RUN): None,
}.get(args)
self.assertEqual(None, api_utils.get_user_role('fake_test'))
self.assertIsNone(api_utils.get_user_role('fake_test'))
self.assertRaises(exc.HTTPError, api_utils.enforce_permissions,
'fake_test', const.ROLE_USER)
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):
# Test no key match.
filtered.all.return_value = []
result = api.get_pubkey(key)
self.assertEqual(None, result)
self.assertIsNone(result)

session.query.assert_called_once_with(mock_model)
query.filter_by.assert_called_once_with(md5_hash=khash)

Loading…
Cancel
Save