summaryrefslogtreecommitdiff
path: root/test/git/test_git.py
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2008-05-21 19:39:55 +0200
committerFlorian Apolloner <florian@apolloner.eu>2008-05-21 19:39:55 +0200
commit71cd409660bc5b8c211dc7c51afae481d822d593 (patch)
treef600d5ed40ad4ddf0c5126fe3cf4cd498ea394d9 /test/git/test_git.py
parent30472cf3132b8c03e528b23d1c7533de740e28ab (diff)
downloadgitpython-71cd409660bc5b8c211dc7c51afae481d822d593.tar.gz
fixed errors in the test, two permission errors remaining, thx to mock?!?!
Also removed the shell_escape tests...
Diffstat (limited to 'test/git/test_git.py')
-rw-r--r--test/git/test_git.py26
1 files changed, 3 insertions, 23 deletions
diff --git a/test/git/test_git.py b/test/git/test_git.py
index 0634a5dd..43fd231c 100644
--- a/test/git/test_git.py
+++ b/test/git/test_git.py
@@ -4,9 +4,8 @@ from git_python import *
class TestGit(object):
def setup(self):
- base = os.path.join(os.path.dirname(__file__), "../.."),
+ base = os.path.join(os.path.dirname(__file__), "../..")
self.git = Git(base)
- self.git_bin_base = "%s --git-dir=%s" % (Git.git_binary, base)
@patch(Git, 'execute')
def test_method_missing_calls_execute(self, git):
@@ -17,7 +16,7 @@ class TestGit(object):
def test_it_transforms_kwargs_into_git_command_arguments(self):
assert_equal(["-s"], self.git.transform_kwargs(**{'s': True}))
- assert_equal(["-s 5"], self.git.transform_kwargs(**{'s': 5}))
+ assert_equal(["-s", 5], self.git.transform_kwargs(**{'s': 5}))
assert_equal(["--max-count"], self.git.transform_kwargs(**{'max_count': True}))
assert_equal(["--max-count=5"], self.git.transform_kwargs(**{'max_count': 5}))
@@ -25,23 +24,4 @@ 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("%s version" % Git.git_binary))
-
- def test_it_transforms_kwargs_shell_escapes_arguments(self):
- assert_equal(["--foo=\"bazz'er\""], self.git.transform_kwargs(**{'foo': "bazz'er"}))
- assert_equal(["-x \"bazz'er\""], self.git.transform_kwargs(**{'x': "bazz'er"}))
-
- @patch(Git, 'execute')
- def test_it_really_shell_escapes_arguments_to_the_git_shell_1(self, git):
- self.git.foo(**{'bar': "bazz'er"})
- assert_true(git.called)
- assert_equal(git.call_args, ((("%s foo --bar=\"bazz'er\"" % self.git_bin_base),), {}))
-
- @patch(Git, 'execute')
- def test_it_really_shell_escapes_arguments_to_the_git_shell_2(self, git):
- self.git.bar(**{'x': "quu'x"})
- assert_true(git.called)
- assert_equal(git.call_args, ((("%s bar -x \"quu'x\"" % self.git_bin_base),), {}))
-
- def test_it_shell_escapes_the_standalone_argument(self):
- self.git.foo("bar's", {})
+ assert_match('^git version [\d\.]*$', self.git.execute(["git","version"]))