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: If621271421faeb5a19bba09534a6770bbfdccc5f
Partial-bug: #1280522
tags/0.2.0
Swapnil Kulkarni (coolsvap) 3 years ago
parent
commit
a2f2a0cf7f
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      ooi/tests/controllers/test_helpers.py

+ 7
- 7
ooi/tests/controllers/test_helpers.py View File

@@ -385,7 +385,7 @@ class TestOpenStackHelper(TestBaseHelper):
385 385
         m.return_value = req_mock
386 386
         server_uuid = uuid.uuid4().hex
387 387
         ret = self.helper.delete(None, server_uuid)
388
-        self.assertEqual(None, ret)
388
+        self.assertIsNone(ret)
389 389
         m.assert_called_with(None, server_uuid)
390 390
 
391 391
     @mock.patch("ooi.api.helpers.exception_from_response")
@@ -413,7 +413,7 @@ class TestOpenStackHelper(TestBaseHelper):
413 413
         m.return_value = req_mock
414 414
         vol_uuid = uuid.uuid4().hex
415 415
         ret = self.helper.volume_delete(None, vol_uuid)
416
-        self.assertEqual(None, ret)
416
+        self.assertIsNone(ret)
417 417
         m.assert_called_with(None, vol_uuid)
418 418
 
419 419
     @mock.patch("ooi.api.helpers.exception_from_response")
@@ -442,7 +442,7 @@ class TestOpenStackHelper(TestBaseHelper):
442 442
         server_uuid = uuid.uuid4().hex
443 443
         action = "start"
444 444
         ret = self.helper.run_action(None, action, server_uuid)
445
-        self.assertEqual(None, ret)
445
+        self.assertIsNone(ret)
446 446
         m.assert_called_with(None, action, server_uuid)
447 447
 
448 448
     @mock.patch("ooi.api.helpers.exception_from_response")
@@ -732,7 +732,7 @@ class TestOpenStackHelper(TestBaseHelper):
732 732
         ret = self.helper.delete_server_volumes_link(None,
733 733
                                                      server_uuid,
734 734
                                                      vol_uuid)
735
-        self.assertEqual(None, ret)
735
+        self.assertIsNone(ret)
736 736
         m.assert_called_with(None, server_uuid, vol_uuid)
737 737
 
738 738
     @mock.patch.object(helpers.OpenStackHelper,
@@ -772,7 +772,7 @@ class TestOpenStackHelper(TestBaseHelper):
772 772
         m.return_value = req_mock
773 773
         ip_uuid = uuid.uuid4().hex
774 774
         ret = self.helper.release_floating_ip(None, ip_uuid)
775
-        self.assertEqual(None, ret)
775
+        self.assertIsNone(ret)
776 776
         m.assert_called_with(None, ip_uuid)
777 777
 
778 778
     @mock.patch.object(helpers.OpenStackHelper, "_get_floating_ip_release_req")
@@ -799,7 +799,7 @@ class TestOpenStackHelper(TestBaseHelper):
799 799
         ip = "192.168.0.20"
800 800
         server = uuid.uuid4().hex
801 801
         ret = self.helper.associate_floating_ip(None, server, ip)
802
-        self.assertEqual(None, ret)
802
+        self.assertIsNone(ret)
803 803
         m.assert_called_with(None, server, ip)
804 804
 
805 805
     @mock.patch.object(helpers.OpenStackHelper, "_get_remove_floating_ip_req")
@@ -811,7 +811,7 @@ class TestOpenStackHelper(TestBaseHelper):
811 811
         ip = "192.168.0.20"
812 812
         server = uuid.uuid4().hex
813 813
         ret = self.helper.remove_floating_ip(None, server, ip)
814
-        self.assertEqual(None, ret)
814
+        self.assertIsNone(ret)
815 815
         m.assert_called_with(None, server, ip)
816 816
 
817 817
     @mock.patch.object(helpers.OpenStackHelper, "_get_remove_floating_ip_req")

Loading…
Cancel
Save