From dc922f3678a1b01cac2b3f1ec74b831ffec52a71 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Thu, 29 May 2008 02:03:18 -0700 Subject: 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 --- test/testlib/helper.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test/testlib') 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__), "..", "..")) -- cgit v1.2.3