diff options
author | David Aguilar <davvid@gmail.com> | 2008-05-29 02:03:18 -0700 |
---|---|---|
committer | David Aguilar <davvid@gmail.com> | 2008-05-29 02:03:18 -0700 |
commit | dc922f3678a1b01cac2b3f1ec74b831ffec52a71 (patch) | |
tree | e75eb8921a18e28010d14f01d02a864419d7c40b /test/testlib/helper.py | |
parent | 2405cf54ac06140a0821f55b34c1d54f699e8e73 (diff) | |
download | gitpython-dc922f3678a1b01cac2b3f1ec74b831ffec52a71.tar.gz |
tests: add a test for git.foo( istream=fh )
This test runs the equivalent of:
"git hash-object < fixtures/cat_file_blob"
with the new istream mechanism and compares the computed hash.
Signed-off-by: David Aguilar <davvid@gmail.com>
Diffstat (limited to 'test/testlib/helper.py')
-rw-r--r-- | test/testlib/helper.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/testlib/helper.py b/test/testlib/helper.py index 19cff8f5..0e3f6bf5 100644 --- a/test/testlib/helper.py +++ b/test/testlib/helper.py @@ -1,10 +1,13 @@ import os -GIT_REPO = os.path.join(os.path.dirname(__file__), "..", "..") +GIT_REPO = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) -def fixture(name): - file = open(os.path.join(os.path.dirname(__file__), "..", "fixtures", name)) - return file.read() +def fixture_path(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() def absolute_project_path(): - return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
\ No newline at end of file + return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) |