From c7fc0d6b1d7d2691d28a7d5f6b8dc5dab7204368 Mon Sep 17 00:00:00 2001 From: LiuNanke Date: Thu, 7 Jan 2016 00:23:05 +0800 Subject: [PATCH] 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 --- glanceclient/tests/unit/test_http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glanceclient/tests/unit/test_http.py b/glanceclient/tests/unit/test_http.py index 5a0eec7..c18660e 100644 --- a/glanceclient/tests/unit/test_http.py +++ b/glanceclient/tests/unit/test_http.py @@ -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