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/git/test_git.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/git/test_git.py')
-rw-r--r-- | test/git/test_git.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/git/test_git.py b/test/git/test_git.py index cae75672..8ea9b8ef 100644 --- a/test/git/test_git.py +++ b/test/git/test_git.py @@ -25,3 +25,10 @@ class TestGit(object): def test_it_executes_git_to_shell_and_returns_result(self): assert_match('^git version [\d\.]*$', self.git.execute(["git","version"])) + + def test_it_accepts_stdin(self): + filename = fixture_path("cat_file_blob") + fh = open(filename, 'r') + assert_equal( "70c379b63ffa0795fdbfbc128e5a2818397b7ef8", + self.git.hash_object(istream=fh, stdin=True) ) + fh.close() |