diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-09-16 15:50:04 -0700 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-10-22 13:11:55 -0500 |
commit | 5c0b8c2b0229992671e076e74c1256a880381d62 (patch) | |
tree | d112dd9129e8e44fd17633fe13d2a359bdbeebbc /testsuite/Testsrc/Testlib/TestClient/TestTools | |
parent | 56d2b72b6f8b2e1a27a16dbfdab10f0b83816ceb (diff) | |
download | bcfg2-5c0b8c2b0229992671e076e74c1256a880381d62.tar.gz bcfg2-5c0b8c2b0229992671e076e74c1256a880381d62.tar.bz2 bcfg2-5c0b8c2b0229992671e076e74c1256a880381d62.zip |
testsuite: Added unit tests for new option parsing
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestClient/TestTools')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py b/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py index 0e9e3a141..b9de703ff 100644 --- a/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py +++ b/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py @@ -17,18 +17,17 @@ while path != "/": path = os.path.dirname(path) from common import * -# try to find true -if os.path.exists("/bin/true"): - TRUE = "/bin/true" -elif os.path.exists("/usr/bin/true"): - TRUE = "/usr/bin/true" -else: - TRUE = None - class TestTool(Bcfg2TestCase): test_obj = Tool + if os.path.exists("/bin/true"): + true = "/bin/true" + elif os.path.exists("/usr/bin/true"): + true = "/usr/bin/true" + else: + true = None + def setUp(self): set_setup_default('command_timeout') set_setup_default('interactive', False) @@ -77,11 +76,11 @@ class TestTool(Bcfg2TestCase): ["/test"] + [e.get("name") for e in important]) t.getSupportedEntries.assert_called_with() - @skipIf(TRUE is None, "/bin/true or equivalent not found") + @skipIf(true is None, "/bin/true or equivalent not found") def test__check_execs(self): t = self.get_obj() if t.__execs__ == []: - t.__execs__.append(TRUE) + t.__execs__.append(self.true) @patch("os.stat") def inner(mock_stat): |