diff options
author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-02-28 17:21:36 +0100 |
---|---|---|
committer | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-03-06 14:03:56 +0100 |
commit | 73b1a388623cf3336e97502280c1a97852b31411 (patch) | |
tree | 1d68999a37b7dc65f92d3457edafeda027962f3d /utils/test | |
parent | 2e0aa00fe7d4a82c0267191deee1b7613787ab9d (diff) | |
download | openshift-73b1a388623cf3336e97502280c1a97852b31411.tar.gz openshift-73b1a388623cf3336e97502280c1a97852b31411.tar.bz2 openshift-73b1a388623cf3336e97502280c1a97852b31411.tar.xz openshift-73b1a388623cf3336e97502280c1a97852b31411.zip |
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.
Diffstat (limited to 'utils/test')
-rw-r--r-- | utils/test/cli_installer_tests.py | 8 |
1 files changed, 1 insertions, 7 deletions
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) |