summaryrefslogtreecommitdiffstats
path: root/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestFile.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestFile.py')
-rw-r--r--testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestFile.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestFile.py b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestFile.py
index b8b006100..5b6d3b1dc 100644
--- a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestFile.py
+++ b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestFile.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import os
+import sys
import copy
import difflib
import binascii
@@ -7,10 +8,19 @@ import lxml.etree
from Bcfg2.Bcfg2Py3k import b64encode, b64decode, u_str
from mock import Mock, MagicMock, patch
from Bcfg2.Client.Tools.POSIX.File import *
-from .Test__init import get_posix_object
-from .Testbase import TestPOSIXTool
-# 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 Testbase import TestPOSIXTool
+from common import XI_NAMESPACE, XI, inPy3k, call, builtins, u, can_skip, \
skip, skipIf, skipUnless, Bcfg2TestCase, DBModelTestCase, syncdb, \
patchIf, datastore