diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-14 14:33:51 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-14 14:33:51 +0200 |
commit | ead94f267065bb55303f79a0a6df477810b3c68d (patch) | |
tree | e93151510cf320a1986c6405409f83d03493fe55 /test/testlib/helper.py | |
parent | ac1cec7066eaa12a8d1a61562bfc6ee77ff5f54d (diff) | |
download | gitpython-ead94f267065bb55303f79a0a6df477810b3c68d.tar.gz |
cmd: added option to return the process directly, allowing to read the output directly from the output stream
commit: now reads commit information directly from the output stream of the process by implementing its iterator method
repo: removed log method as it was redundant ( equal to the commits method )
Diffstat (limited to 'test/testlib/helper.py')
-rw-r--r-- | test/testlib/helper.py | 11 |
1 files changed, 11 insertions, 0 deletions
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) |