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: I834ec0fd6d335383ee2ef71efe8cd51a25a22650
Partial-bug: #1280522
tags/0.10
Swapnil Kulkarni (coolsvap) 3 years ago
parent
commit
658d2e5ffe

+ 3
- 3
stackalytics/tests/unit/test_record_processor.py View File

@@ -105,7 +105,7 @@ class TestRecordProcessor(testtools.TestCase):
105 105
         record_processor_inst = self.make_record_processor()
106 106
         email = 'foo@boo.com'
107 107
         res = record_processor_inst._get_company_by_email(email)
108
-        self.assertEqual(None, res)
108
+        self.assertIsNone(res)
109 109
 
110 110
     # get_lp_info
111 111
 
@@ -387,7 +387,7 @@ class TestRecordProcessor(testtools.TestCase):
387 387
             user_id='johndoe@ibm.com')
388 388
         self.assertIn('johndoe@ibm.com', user['emails'])
389 389
         self.assertEqual('IBM', user['companies'][0]['company_name'])
390
-        self.assertEqual(None, user['launchpad_id'])
390
+        self.assertIsNone(user['launchpad_id'])
391 391
 
392 392
     def test_process_review_new_user(self):
393 393
         # User is known to LP, but new to us
@@ -1023,7 +1023,7 @@ class TestRecordProcessor(testtools.TestCase):
1023 1023
                 'companies': [{'company_name': 'IBM', 'end_date': 0}]}
1024 1024
         runtime_storage_inst = record_processor_inst.runtime_storage_inst
1025 1025
         self.assertEqual(2, runtime_storage_inst.get_by_key('user:count'))
1026
-        self.assertEqual(None, user_processor.load_user(
1026
+        self.assertIsNone(user_processor.load_user(
1027 1027
             runtime_storage_inst, 1))
1028 1028
         self.assertEqual(user, user_processor.load_user(
1029 1029
             runtime_storage_inst, 2))

+ 1
- 1
stackalytics/tests/unit/test_utils.py View File

@@ -123,7 +123,7 @@ class TestUtils(testtools.TestCase):
123 123
 
124 124
         profile = None
125 125
         utils.validate_lp_display_name(profile)
126
-        self.assertEqual(None, profile)
126
+        self.assertIsNone(profile)
127 127
 
128 128
     def test_pipeline_processor(self):
129 129
         counter = dict(n=0)

Loading…
Cancel
Save