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: I5f40d8a0ec6e7ec24a20a183c5313d6dac52dbfe
Closes-bug: #1280522
tags/4.0.0.0b2
Shuquan Huang 3 years ago
parent
commit
3ed0dc8b7b

+ 5
- 6
sahara/tests/unit/plugins/storm/test_plugin.py View File

@@ -66,9 +66,8 @@ class StormPluginTest(base.SaharaWithDbTestCase):
66 66
         plugin = pb.PLUGINS.get_plugin(cluster.plugin_name)
67 67
         supervisor_id = [node.id for node in cluster.node_groups
68 68
                          if node.name == 'supervisor']
69
-        self.assertEqual(None,
70
-                         plugin._validate_existing_ng_scaling(cluster,
71
-                                                              supervisor_id))
69
+        self.assertIsNone(plugin._validate_existing_ng_scaling(cluster,
70
+                                                               supervisor_id))
72 71
 
73 72
     def test_validate_additional_ng_scaling(self):
74 73
         data = {'name': "cluster",
@@ -97,9 +96,9 @@ class StormPluginTest(base.SaharaWithDbTestCase):
97 96
         plugin = pb.PLUGINS.get_plugin(cluster.plugin_name)
98 97
         supervisor_id = [node.id for node in cluster.node_groups
99 98
                          if node.name == 'supervisor']
100
-        self.assertEqual(None,
101
-                         plugin._validate_additional_ng_scaling(cluster,
102
-                                                                supervisor_id))
99
+        self.assertIsNone(plugin._validate_additional_ng_scaling(cluster,
100
+                                                                 supervisor_id)
101
+                          )
103 102
 
104 103
     def test_validate_existing_ng_scaling_raises(self):
105 104
         data = {'name': "cluster",

+ 1
- 1
sahara/tests/unit/plugins/vanilla/test_utils.py View File

@@ -101,4 +101,4 @@ class TestUtils(base.SaharaWithDbTestCase):
101 101
 
102 102
         cl = tu.create_cluster('cl1', 't1', 'vanilla', '2.6.0',
103 103
                                [self.ng_manager])
104
-        self.assertEqual(None, u.get_secondarynamenode(cl))
104
+        self.assertIsNone(u.get_secondarynamenode(cl))

Loading…
Cancel
Save