Merge "Replace assertTrue(isinstance()) with assertIsInstance()"
This commit is contained in:
commit
a052de34bb
|
@ -175,7 +175,7 @@ class TestOsUtils(unittest.TestCase):
|
|||
"""Test retrieving consumer usage."""
|
||||
with mock.patch('openstack.connection.Connection') as MockClass:
|
||||
MockClass.return_value = MockedOpenStackConn()
|
||||
self.assertTrue(isinstance(self.osu.get_consumer_usage(), list))
|
||||
self.assertIsInstance(self.osu.get_consumer_usage(), list)
|
||||
|
||||
def test_get_consumer_usage_with_servers(self):
|
||||
"""Test retrieving consumer usage with servers list."""
|
||||
|
|
|
@ -107,7 +107,7 @@ class TestKvm(unittest.TestCase):
|
|||
"""Ensure the run() method works."""
|
||||
sys.modules.pop('libvirt', None)
|
||||
result = tests.runner('kvm')
|
||||
self.assertTrue(isinstance(result.exception, SystemExit))
|
||||
self.assertIsInstance(result.exception, SystemExit)
|
||||
|
||||
def test_run_failure(self):
|
||||
"""Ensure the run() method works."""
|
||||
|
|
|
@ -49,13 +49,13 @@ class TestUtils(unittest.TestCase):
|
|||
os.remove(cache_db)
|
||||
|
||||
def test_is_int_is_int(self): # noqa
|
||||
self.assertTrue(isinstance(utils.is_int(value=1), int))
|
||||
self.assertIsInstance(utils.is_int(value=1), int)
|
||||
|
||||
def test_is_int_is_int_str(self): # noqa
|
||||
self.assertTrue(isinstance(utils.is_int(value='1'), int))
|
||||
self.assertIsInstance(utils.is_int(value='1'), int)
|
||||
|
||||
def test_is_int_is_not_int(self): # noqa
|
||||
self.assertTrue(isinstance(utils.is_int(value='a'), str))
|
||||
self.assertIsInstance(utils.is_int(value='a'), str)
|
||||
|
||||
def test_read_config_not_found(self): # noqa
|
||||
self.assertRaises(
|
||||
|
@ -65,7 +65,7 @@ class TestUtils(unittest.TestCase):
|
|||
)
|
||||
|
||||
def test_read_config_found_dict_return(self): # noqa
|
||||
self.assertTrue(isinstance(self.config, dict))
|
||||
self.assertIsInstance(self.config, dict)
|
||||
|
||||
def test_read_config_found_defaults_in_sections(self):
|
||||
"""Read config defaults from each section."""
|
||||
|
|
Loading…
Reference in New Issue