From e3ad6af9647deacd154bb030b9e92e97927ee68b Mon Sep 17 00:00:00 2001 From: melissaml Date: Mon, 3 Oct 2016 16:36:33 +0800 Subject: [PATCH] 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 --- ironic_tempest_plugin/tests/api/admin/test_nodes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ironic_tempest_plugin/tests/api/admin/test_nodes.py b/ironic_tempest_plugin/tests/api/admin/test_nodes.py index 688a94f01d..e4a8eea02a 100644 --- a/ironic_tempest_plugin/tests/api/admin/test_nodes.py +++ b/ironic_tempest_plugin/tests/api/admin/test_nodes.py @@ -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):