From 55f0245f3ee538ec49e84bcb28c33b135a07f0b9 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 31 May 2008 14:54:32 -0700 Subject: tests: allow "git version" test to pass on arbitrary git versions Sometimes people run development versions of git. On these versions, "git version" returns, for example: git version 1.5.4.rc2.1105.gfc5f2 The test_it_executes_git_to_shell_and_returns_result testcase was updated to accept these versions of git. Signed-off-by: David Aguilar --- test/git/test_git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/git/test_git.py') diff --git a/test/git/test_git.py b/test/git/test_git.py index d0f3b72e..2b2464b0 100644 --- a/test/git/test_git.py +++ b/test/git/test_git.py @@ -24,7 +24,7 @@ class TestGit(object): assert_equal(["-s", "-t"], self.git.transform_kwargs(**{'s': True, 't': True})) def test_it_executes_git_to_shell_and_returns_result(self): - assert_match('^git version [\d\.]*$', self.git.execute(["git","version"])) + assert_match('^git version [\d\.]{2}.*$', self.git.execute(["git","version"])) def test_it_accepts_stdin(self): filename = fixture_path("cat_file_blob") -- cgit v1.2.1 From 12b32450c210cec1fdd8b2c19d564776e8054aa3 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 31 May 2008 15:33:47 -0700 Subject: tests: ensure cmd.execute can handle large output This test case ensures that cmd.execute can always handle large command outputs. This test does so by reading a 700k file into memory. Signed-off-by: David Aguilar --- test/git/test_git.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/git/test_git.py') diff --git a/test/git/test_git.py b/test/git/test_git.py index 2b2464b0..d11bd661 100644 --- a/test/git/test_git.py +++ b/test/git/test_git.py @@ -51,3 +51,7 @@ class TestGit(object): r"(\. See 'git --help'\.)?" + os.linesep, self.git.this_does_not_exist(with_stderr=True, with_raw_output=True)) + + def test_it_handles_large_input(self): + output = self.git.execute(["cat", "/bin/bash"]) + assert( len(output) > 4096 * 1024 ) # at least 4k -- cgit v1.2.1