From 73b1a388623cf3336e97502280c1a97852b31411 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Tue, 28 Feb 2017 17:21:36 +0100 Subject: Fix test Instead of checking if a string is True, check if 'found' is True, the string is the error message. Also, we can remove the loop and use the simpler Python 'in' construct. --- utils/test/cli_installer_tests.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'utils/test') diff --git a/utils/test/cli_installer_tests.py b/utils/test/cli_installer_tests.py index 067bb9de7..21e0ec722 100644 --- a/utils/test/cli_installer_tests.py +++ b/utils/test/cli_installer_tests.py @@ -1010,13 +1010,7 @@ class AttendedCliTests(OOCliFixture): full_line = "%s=%s" % (a, b) tokens = full_line.split() if tokens[0] == host: - found = False - for token in tokens: - if token == variable: - found = True - continue - self.assertTrue("Unable to find %s in line: %s" % - (variable, full_line), found) + self.assertTrue(variable in tokens[1:], "Unable to find %s in line: %s" % (variable, full_line)) return self.fail("unable to find host %s in inventory" % host) -- cgit v1.2.3