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: Ia1af9f64f4f0a66c1429d81313b2c27a7c67cdd7
Closes-bug: #1280522
tags/1.13.0
Shuquan Huang 3 years ago
parent
commit
88b7e643b9
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      os_client_config/tests/test_cloud_config.py

+ 3
- 3
os_client_config/tests/test_cloud_config.py View File

@@ -47,7 +47,7 @@ class TestCloudConfig(base.TestCase):
47 47
         self.assertEqual(1, cc.a)
48 48
 
49 49
         # Look up prefixed attribute, fail - returns None
50
-        self.assertEqual(None, cc.os_b)
50
+        self.assertIsNone(cc.os_b)
51 51
 
52 52
         # Look up straight value, then prefixed value
53 53
         self.assertEqual(3, cc.c)
@@ -139,7 +139,7 @@ class TestCloudConfig(base.TestCase):
139 139
         self.assertEqual('region-al', cc.get_region_name())
140 140
         self.assertEqual('region-al', cc.get_region_name('image'))
141 141
         self.assertEqual('region-bl', cc.get_region_name('compute'))
142
-        self.assertEqual(None, cc.get_api_version('image'))
142
+        self.assertIsNone(cc.get_api_version('image'))
143 143
         self.assertEqual('2', cc.get_api_version('compute'))
144 144
         self.assertEqual('mage', cc.get_service_type('image'))
145 145
         self.assertEqual('compute', cc.get_service_type('compute'))
@@ -149,7 +149,7 @@ class TestCloudConfig(base.TestCase):
149 149
                          cc.get_endpoint('compute'))
150 150
         self.assertEqual(None,
151 151
                          cc.get_endpoint('image'))
152
-        self.assertEqual(None, cc.get_service_name('compute'))
152
+        self.assertIsNone(cc.get_service_name('compute'))
153 153
         self.assertEqual('locks', cc.get_service_name('identity'))
154 154
 
155 155
     def test_volume_override(self):

Loading…
Cancel
Save