Change assertTrue(isinstance()) by optimal assert
Some of tests use different method of assertTrue(isinstance(A, B)) or assertEqual(type(A), B). The correct way is to use assertIsInstance(A, B) provided by testtools Change-Id: I30c6b98350d7b58b3be59aee267f98fea4e483ab
This commit is contained in:
parent
d9731819c4
commit
e38afc1f18
|
@ -24,7 +24,7 @@ class UUIDUtilsTest(test_base.BaseTestCase):
|
|||
|
||||
def test_generate_uuid(self):
|
||||
uuid_string = uuidutils.generate_uuid()
|
||||
self.assertTrue(isinstance(uuid_string, str))
|
||||
self.assertIsInstance(uuid_string, str)
|
||||
self.assertEqual(len(uuid_string), 36)
|
||||
# make sure there are 4 dashes
|
||||
self.assertEqual(len(uuid_string.replace('-', '')), 32)
|
||||
|
|
Loading…
Reference in New Issue