From ccea3dd8cbc2c87cb73fc9e8b0120e30816034a6 Mon Sep 17 00:00:00 2001 From: Cao Xuan Hoang Date: Mon, 6 Feb 2017 10:53:09 +0700 Subject: [PATCH] Replace 'assertTrue(a in b)' with 'assertIn(a, b)' trivialfix Change-Id: Iebfb9e462d9a3c1f0cdc5f54f42ffc0651167f8f --- tests/test_inventory.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_inventory.py b/tests/test_inventory.py index bc1efcc85f..6e92fa0b45 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -1239,7 +1239,7 @@ class TestConfigMatchesEnvironment(unittest.TestCase): with warnings.catch_warnings(record=True) as wl: di._check_all_conf_groups_present(bad_config, self.env) self.assertEqual(1, len(wl)) - self.assertTrue('bogus_key' in str(wl[0].message)) + self.assertIn('bogus_key', str(wl[0].message)) def test_multiple_extra_keys(self): bad_config = get_config() @@ -1251,8 +1251,8 @@ class TestConfigMatchesEnvironment(unittest.TestCase): self.assertEqual(2, len(wl)) warn_msgs = [str(warn.message) for warn in wl] warn_msgs.sort() - self.assertTrue('bogus_key1' in warn_msgs[0]) - self.assertTrue('bogus_key2' in warn_msgs[1]) + self.assertIn('bogus_key1', warn_msgs[0]) + self.assertIn('bogus_key2', warn_msgs[1]) def test_confirm_exclusions(self): """Ensure the excluded keys in the function are present."""