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:
gecong1973 2016-09-30 15:25:43 +08:00
parent d9731819c4
commit e38afc1f18
1 changed files with 1 additions and 1 deletions

View File

@ -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)