diff options
Diffstat (limited to 'testsuite/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py')
-rw-r--r-- | testsuite/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py index 06585bb80..b447ab642 100644 --- a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py +++ b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/Testbase.py @@ -1,13 +1,23 @@ import os +import sys import copy import stat import lxml.etree from mock import Mock, MagicMock, patch import Bcfg2.Client.Tools from Bcfg2.Client.Tools.POSIX.base import * -from .Test__init import get_posix_object -# python 2.5 can't import * from relative imports -from .....common import XI_NAMESPACE, XI, inPy3k, call, builtins, u, can_skip, \ + +# 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 Test__init import get_posix_object +from common import XI_NAMESPACE, XI, inPy3k, call, builtins, u, can_skip, \ skip, skipIf, skipUnless, Bcfg2TestCase, DBModelTestCase, syncdb, \ patchIf, datastore |