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: I109bef1afbbdd3a2cf25e9fb7133509516910891
Closes-bug: #1280522
tags/1.1.0
Shuquan Huang 3 years ago
parent
commit
a90b16ca84
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      ironicclient/tests/unit/v1/test_node.py

+ 5
- 5
ironicclient/tests/unit/v1/test_node.py View File

@@ -735,7 +735,7 @@ class NodeManagerTest(testtools.TestCase):
735 735
             ('PUT', '/v1/nodes/%s/maintenance' % NODE1['uuid'], {}, body),
736 736
         ]
737 737
         self.assertEqual(expect, self.api.calls)
738
-        self.assertEqual(None, maintenance)
738
+        self.assertIsNone(maintenance)
739 739
 
740 740
     def test_node_set_maintenance_false(self):
741 741
         maintenance = self.mgr.set_maintenance(NODE1['uuid'], 'false')
@@ -743,7 +743,7 @@ class NodeManagerTest(testtools.TestCase):
743 743
             ('DELETE', '/v1/nodes/%s/maintenance' % NODE1['uuid'], {}, None),
744 744
         ]
745 745
         self.assertEqual(expect, self.api.calls)
746
-        self.assertEqual(None, maintenance)
746
+        self.assertIsNone(maintenance)
747 747
 
748 748
     def test_node_set_maintenance_on(self):
749 749
         maintenance = self.mgr.set_maintenance(NODE1['uuid'], 'on',
@@ -753,7 +753,7 @@ class NodeManagerTest(testtools.TestCase):
753 753
             ('PUT', '/v1/nodes/%s/maintenance' % NODE1['uuid'], {}, body),
754 754
         ]
755 755
         self.assertEqual(expect, self.api.calls)
756
-        self.assertEqual(None, maintenance)
756
+        self.assertIsNone(maintenance)
757 757
 
758 758
     def test_node_set_maintenance_off(self):
759 759
         maintenance = self.mgr.set_maintenance(NODE1['uuid'], 'off')
@@ -761,7 +761,7 @@ class NodeManagerTest(testtools.TestCase):
761 761
             ('DELETE', '/v1/nodes/%s/maintenance' % NODE1['uuid'], {}, None),
762 762
         ]
763 763
         self.assertEqual(expect, self.api.calls)
764
-        self.assertEqual(None, maintenance)
764
+        self.assertIsNone(maintenance)
765 765
 
766 766
     def test_node_set_maintenance_bad(self):
767 767
         self.assertRaises(exc.InvalidAttribute, self.mgr.set_maintenance,
@@ -775,7 +775,7 @@ class NodeManagerTest(testtools.TestCase):
775 775
             ('PUT', '/v1/nodes/%s/maintenance' % NODE1['uuid'], {}, body),
776 776
         ]
777 777
         self.assertEqual(expect, self.api.calls)
778
-        self.assertEqual(None, maintenance)
778
+        self.assertIsNone(maintenance)
779 779
 
780 780
     def test_node_set_power_state(self):
781 781
         power_state = self.mgr.set_power_state(NODE1['uuid'], "on")

Loading…
Cancel
Save