summaryrefslogtreecommitdiffstats
path: root/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestNonexistent.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-23 07:38:54 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-23 07:39:00 -0400
commit4d3e89b06977362707ccb0d7f70311181b4e0da8 (patch)
tree07f5ec3e109e4058a22cf6a375056bae5773ef67 /testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestNonexistent.py
parent8b92e0ab89e96c7e810da89ccacecfaee3e142c2 (diff)
downloadbcfg2-4d3e89b06977362707ccb0d7f70311181b4e0da8.tar.gz
bcfg2-4d3e89b06977362707ccb0d7f70311181b4e0da8.tar.bz2
bcfg2-4d3e89b06977362707ccb0d7f70311181b4e0da8.zip
removed relative imports from testsuite for py2.4 compat
Diffstat (limited to 'testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestNonexistent.py')
-rw-r--r--testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestNonexistent.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestNonexistent.py b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestNonexistent.py
index b785e3b1f..375ff00eb 100644
--- a/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestNonexistent.py
+++ b/testsuite/Testlib/TestClient/TestTools/TestPOSIX/TestNonexistent.py
@@ -1,12 +1,22 @@
import os
+import sys
import copy
import lxml.etree
from mock import Mock, MagicMock, patch
from Bcfg2.Client.Tools.POSIX.Nonexistent import *
-from .Test__init import get_config, 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_config, 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