Change assertTrue(isinstance()) by optimal assert

assertTrue(isinstance(A, B)) or assertEqual(type(A), B) in tests
should be replaced by assertIsInstance(A, B) provided by testtools.


Change-Id: I7135d3b7fe15b16c17b7581e553ce5d289b58f43
Related-bug: #1268480
This commit is contained in:
LiuNanke 2016-01-07 00:23:05 +08:00
parent 2973489622
commit c7fc0d6b1d
1 changed files with 1 additions and 1 deletions

View File

@ -275,7 +275,7 @@ class TestClient(testtools.TestCase):
headers={"Content-Type": "application/octet-stream"})
resp, body = self.client.get(path)
self.assertTrue(isinstance(body, types.GeneratorType))
self.assertIsInstance(body, types.GeneratorType)
self.assertEqual([data], list(body))
@original_only