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.

I have searched all the tests, there is only one wrong usage.

Change-Id: Ib1db1a2dca7b5d8cbfe823973e4b571d0f0925c5
Closes-bug: #1268480
This commit is contained in:
wanghong 2014-03-06 16:18:39 +08:00
parent a9dee7948d
commit ab5c5b5d7c
1 changed files with 1 additions and 1 deletions

View File

@ -26,4 +26,4 @@ class TestHTTPExceptions(testtools.TestCase):
def test_from_response(self):
"""exc.from_response should return instance of an HTTP exception."""
out = exc.from_response(FakeResponse(400))
self.assertTrue(isinstance(out, exc.HTTPBadRequest))
self.assertIsInstance(out, exc.HTTPBadRequest)