Browse Source

Replace assertEqual(*, None) with assertIsNone in tests.

For more clear messages in case of failure.
Closes-bug: #1280522

Change-Id: Icd110ab619dc500cd6bb10137e4f839812533f7b
tags/3.0.0.0b2^2
vishal mahajan 3 years ago
parent
commit
0e65d5f920

+ 4
- 4
congress/tests/datalog/test_compiler.py View File

@@ -29,12 +29,12 @@ class TestParser(base.TestCase):
29 29
         """Test correct parsing of tablenames."""
30 30
         p = compile.parse1('p(1)')
31 31
         self.assertEqual(p.table.table, 'p')
32
-        self.assertEqual(p.table.modal, None)
33
-        self.assertEqual(p.table.service, None)
32
+        self.assertIsNone(p.table.modal)
33
+        self.assertIsNone(p.table.service)
34 34
 
35 35
         p = compile.parse1('nova:p(1)')
36 36
         self.assertEqual(p.table.table, 'p')
37
-        self.assertEqual(p.table.modal, None)
37
+        self.assertIsNone(p.table.modal)
38 38
         self.assertEqual(p.table.service, 'nova')
39 39
 
40 40
         p = compile.parse1('execute[nova:p(1)]')
@@ -185,7 +185,7 @@ class TestColumnReferences(base.TestCase):
185 185
         lit = rule.body[0]
186 186
         self.assertFalse(lit.is_negated())
187 187
         self.assertEqual(lit.table.table, "q")
188
-        self.assertEqual(lit.table.modal, None)
188
+        self.assertIsNone(lit.table.modal)
189 189
         self.assertEqual(lit.table.service, 'nova')
190 190
         self.assertEqual(len(lit.arguments), 0)
191 191
         self.assertEqual(len(lit.named_arguments), 1)

+ 1
- 1
congress/tests/db/test_db_policy_rules.py View File

@@ -76,7 +76,7 @@ class TestPolicyRulesDb(base.SqlTestCase):
76 76
                                         comment=comment)
77 77
         db_policy_rules.delete_policy_rule(id)
78 78
         rule = db_policy_rules.get_policy_rule(id, policy_name)
79
-        self.assertEqual(rule, None)
79
+        self.assertIsNone(rule)
80 80
 
81 81
     def test_add_delete_get_deleted_policy_rule(self):
82 82
         id = uuidutils.generate_uuid()

Loading…
Cancel
Save