Browse Source

Replace assertEqual(None, *) with assertIsNone

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

Change-Id: I9a30b67f0329280e06e746af9b82b448552a2a52
Closes-bug: #1280522
tags/1.0.0
Bo Wang 3 years ago
parent
commit
28f68b5d1c

+ 2
- 2
heatclient/tests/unit/osc/v1/test_software_config.py View File

@@ -260,8 +260,8 @@ class TestConfigShow(TestConfig):
260 260
         self.mock_client.software_configs.get.assert_called_with(**{
261 261
             'config_id': '96dfee3f-27b7-42ae-a03e-966226871ae6',
262 262
         })
263
-        self.assertEqual(None, columns)
264
-        self.assertEqual(None, data)
263
+        self.assertIsNone(columns)
264
+        self.assertIsNone(data)
265 265
 
266 266
     def test_config_show_not_found(self):
267 267
         arglist = ['96dfee3f-27b7-42ae-a03e-966226871ae6']

+ 4
- 9
heatclient/tests/unit/test_format_utils.py View File

@@ -92,21 +92,16 @@ abcde
92 92
         self.assertEqual(expected, self.app.stdout.make_string())
93 93
 
94 94
     def test_indent_and_truncate(self):
95
-        self.assertEqual(
96
-            None,
97
-            format_utils.indent_and_truncate(None))
98
-        self.assertEqual(
99
-            None,
100
-            format_utils.indent_and_truncate(None, truncate=True))
95
+        self.assertIsNone(format_utils.indent_and_truncate(None))
96
+        self.assertIsNone(format_utils.indent_and_truncate(None,
97
+                                                           truncate=True))
101 98
         self.assertEqual(
102 99
             '',
103 100
             format_utils.indent_and_truncate(''))
104 101
         self.assertEqual(
105 102
             'one',
106 103
             format_utils.indent_and_truncate('one'))
107
-        self.assertEqual(
108
-            None,
109
-            format_utils.indent_and_truncate(None, spaces=2))
104
+        self.assertIsNone(format_utils.indent_and_truncate(None, spaces=2))
110 105
         self.assertEqual(
111 106
             '',
112 107
             format_utils.indent_and_truncate('', spaces=2))

Loading…
Cancel
Save