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: I5ef78693999f9bd87cc3ea8419e6e62027076383
Closes-Bug:#1280522
tags/0.2.0
llg8212 5 years ago
parent
commit
ec1a3dabde
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      tuskar/tests/api/controllers/v1/test_models.py

+ 4
- 4
tuskar/tests/api/controllers/v1/test_models.py View File

@@ -12,7 +12,7 @@
12 12
 # License for the specific language governing permissions and limitations
13 13
 # under the License.
14 14
 
15
-import unittest
15
+import testtools
16 16
 
17 17
 from wsme import types as wtypes
18 18
 
@@ -20,7 +20,7 @@ from tuskar.api.controllers.v1 import models as api_models
20 20
 from tuskar.db.sqlalchemy import models as db_models
21 21
 
22 22
 
23
-class BaseTests(unittest.TestCase):
23
+class BaseTests(testtools.TestCase):
24 24
 
25 25
     def test_lookup(self):
26 26
         # Setup
@@ -32,10 +32,10 @@ class BaseTests(unittest.TestCase):
32 32
 
33 33
         # Test
34 34
         self.assertEqual(1, stub._lookup('a1'))
35
-        self.assertEqual(None, stub._lookup('a2'))
35
+        self.assertIsNone(stub._lookup('a2'))
36 36
 
37 37
 
38
-class OvercloudModelTests(unittest.TestCase):
38
+class OvercloudModelTests(testtools.TestCase):
39 39
 
40 40
     def test_from_db_model(self):
41 41
         # Setup

Loading…
Cancel
Save