diff options
Diffstat (limited to 'test/testlib')
-rw-r--r-- | test/testlib/__init__.py | 1 | ||||
-rw-r--r-- | test/testlib/helper.py | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/testlib/__init__.py b/test/testlib/__init__.py index 2133eb8c..f364171b 100644 --- a/test/testlib/__init__.py +++ b/test/testlib/__init__.py @@ -8,6 +8,7 @@ import inspect from mock import * from asserts import * from helper import * +from unittest import TestCase __all__ = [ name for name, obj in locals().items() if not (name.startswith('_') or inspect.ismodule(obj)) ] diff --git a/test/testlib/helper.py b/test/testlib/helper.py index 74f48447..b66d3eaa 100644 --- a/test/testlib/helper.py +++ b/test/testlib/helper.py @@ -17,3 +17,14 @@ def fixture(name): def absolute_project_path(): 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) |