summaryrefslogtreecommitdiff
path: root/test/testlib/helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/testlib/helper.py')
-rw-r--r--test/testlib/helper.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/testlib/helper.py b/test/testlib/helper.py
index ca262ee4..b66d3eaa 100644
--- a/test/testlib/helper.py
+++ b/test/testlib/helper.py
@@ -9,11 +9,22 @@ import os
GIT_REPO = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
def fixture_path(name):
- test_dir = os.path.dirname(os.path.dirname(__file__))
- return os.path.join(test_dir, "fixtures", name)
+ test_dir = os.path.dirname(os.path.dirname(__file__))
+ return os.path.join(test_dir, "fixtures", name)
def fixture(name):
- return open(fixture_path(name)).read()
+ return open(fixture_path(name)).read()
def absolute_project_path():
- return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
+ return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
+
+
+class ListProcessAdapter(object):
+ """Allows to use lists as Process object as returned by SubProcess.Popen.
+ Its tailored to work with the test system only"""
+
+ def __init__(self, input_list_or_string):
+ l = input_list_or_string
+ if isinstance(l,basestring):
+ l = l.splitlines()
+ self.stdout = iter(l)