Modify use of assertTrue(A in B)

Developers should use assertIn(A, B) instead of assertTrue(A in B).

Because assertIn raise more meaningful errors:
      self.assertIn(3, [1, 2]
      >>> MismatchError: 3 not in [1, 2]
      self.assertTrue(3 in [1, 2])
      >>> AssertionError: False is not true

TrivialFix

Change-Id: I09f0a348afba8b475b00913172a4dc0ce56f47ad
This commit is contained in:
melissaml 2016-09-14 11:23:07 +08:00
parent ecd9c097c1
commit 0bbf801e29

View File

@ -481,7 +481,7 @@ class TestConfigChecks(TestConfigCheckBase):
with self.assertRaises(SystemExit) as context:
get_inventory()
expectedLog = "provider networks can't be found under global_overrides"
self.assertTrue(expectedLog in context.exception.message)
self.assertIn(expectedLog, context.exception.message)
def test_global_overrides_check(self):
# create config file without global_overrides