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: I40c4d43673d5643a4e4cd50fd6abe21559222749
Closes-bug: #1280522
tags/5.0.0.0b2
Shuquan Huang 3 years ago
parent
commit
5e5cc3260f
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      trove/tests/unittests/secgroups/test_security_group.py

+ 9
- 9
trove/tests/unittests/secgroups/test_security_group.py View File

@@ -133,9 +133,9 @@ class SecurityGroupDeleteTest(trove_testtools.TestCase):
133 133
     def test_failed_to_get_assoc_on_delete(self):
134 134
 
135 135
         sec_mod.SecurityGroupInstanceAssociation.find_by = self.fException
136
-        self.assertEqual(None,
137
-                         sec_mod.SecurityGroup.delete_for_instance(
138
-                             uuid.uuid4(), self.context))
136
+        self.assertIsNone(
137
+            sec_mod.SecurityGroup.delete_for_instance(
138
+                uuid.uuid4(), self.context))
139 139
 
140 140
     def test_get_security_group_from_assoc_with_db_exception(self):
141 141
 
@@ -154,9 +154,9 @@ class SecurityGroupDeleteTest(trove_testtools.TestCase):
154 154
 
155 155
         sec_mod.SecurityGroupInstanceAssociation.find_by = Mock(
156 156
             return_value=new_fake_RemoteSecGrAssoc())
157
-        self.assertEqual(None,
158
-                         sec_mod.SecurityGroup.delete_for_instance(
159
-                             i_id, self.context))
157
+        self.assertIsNone(
158
+            sec_mod.SecurityGroup.delete_for_instance(
159
+                i_id, self.context))
160 160
 
161 161
     def test_delete_secgr_assoc_with_db_exception(self):
162 162
 
@@ -169,6 +169,6 @@ class SecurityGroupDeleteTest(trove_testtools.TestCase):
169 169
         self.assertTrue(hasattr(sec_mod.SecurityGroupInstanceAssociation.
170 170
                                 find_by(i_id, deleted=False).
171 171
                                 get_security_group(), 'delete'))
172
-        self.assertEqual(None,
173
-                         sec_mod.SecurityGroup.delete_for_instance(
174
-                             i_id, self.context))
172
+        self.assertIsNone(
173
+            sec_mod.SecurityGroup.delete_for_instance(
174
+                i_id, self.context))

Loading…
Cancel
Save