Replace assertTrue(isinstance()) with assertIsInstance()

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: I32afee50ebabab9595b05bbfdf83d49aa09858f1
This commit is contained in:
melissaml 2016-10-03 16:36:33 +08:00
parent 85750a1913
commit e3ad6af964

View File

@ -138,14 +138,14 @@ class TestNodes(base.BaseBaremetalTest):
body = self.client.get_node_boot_device(self.node['uuid'])
self.assertIn('boot_device', body)
self.assertIn('persistent', body)
self.assertTrue(isinstance(body['boot_device'], six.string_types))
self.assertTrue(isinstance(body['persistent'], bool))
self.assertIsInstance(body['boot_device'], six.string_types)
self.assertIsInstance(body['persistent'], bool)
@test.idempotent_id('3622bc6f-3589-4bc2-89f3-50419c66b133')
def test_get_node_supported_boot_devices(self):
body = self.client.get_node_supported_boot_devices(self.node['uuid'])
self.assertIn('supported_boot_devices', body)
self.assertTrue(isinstance(body['supported_boot_devices'], list))
self.assertIsInstance(body['supported_boot_devices'], list)
@test.idempotent_id('f63b6288-1137-4426-8cfe-0d5b7eb87c06')
def test_get_console(self):