From adf037aa31031be164e68b1a4817a7cada936c90 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 2 Oct 2012 15:00:03 -0400 Subject: testsuite: added unit tests for Cfg handlers --- .../TestPlugins/TestCfg/TestCfgPlaintextGenerator.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPlaintextGenerator.py (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPlaintextGenerator.py') diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPlaintextGenerator.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPlaintextGenerator.py new file mode 100644 index 000000000..5c6767a59 --- /dev/null +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPlaintextGenerator.py @@ -0,0 +1,18 @@ +import os +import sys +from Bcfg2.Server.Plugins.Cfg.CfgPlaintextGenerator import * + +# add all parent testsuite directories to sys.path to allow (most) +# relative imports in python 2.4 +path = os.path.dirname(__file__) +while path != "/": + if os.path.basename(path).lower().startswith("test"): + sys.path.append(path) + if os.path.basename(path) == "testsuite": + break + path = os.path.dirname(path) +from TestServer.TestPlugins.TestCfg.Test_init import TestCfgGenerator + + +class TestCfgPlaintextGenerator(TestCfgGenerator): + test_obj = CfgPlaintextGenerator -- cgit v1.2.3-1-g7c22