summaryrefslogtreecommitdiff
path: root/git/test/test_git.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-19 14:36:39 +0200
committerGitHub <noreply@github.com>2016-10-19 14:36:39 +0200
commitaab7dc2c7771118064334ee475dff8a6bb176b57 (patch)
tree29f85b71fb56c3d8015bd71873a7c24cf82ed50f /git/test/test_git.py
parent9e4a4545dd513204efb6afe40e4b50c3b5f77e50 (diff)
parentbf8ce9464987c7b0dbe6acbc2cc2653e98ec739a (diff)
downloadgitpython-aab7dc2c7771118064334ee475dff8a6bb176b57.tar.gz
Merge pull request #536 from bpoldrack/nf-persistent-git-options
Allow for setting git generic options, persisted across subcommand calls.
Diffstat (limited to 'git/test/test_git.py')
-rw-r--r--git/test/test_git.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/git/test/test_git.py b/git/test/test_git.py
index bd8ebee2..14c70e18 100644
--- a/git/test/test_git.py
+++ b/git/test/test_git.py
@@ -160,6 +160,20 @@ class TestGit(TestBase):
git_command_version = self.git.version()
self.assertEquals(git_version, git_command_version)
+ def test_persistent_options(self):
+ git_command_version = self.git.version()
+ # analog to test_options_are_passed_to_git
+ self.git.set_persistent_git_options(version=True)
+ git_version = self.git.NoOp()
+ self.assertEquals(git_version, git_command_version)
+ # subsequent calls keep this option:
+ git_version_2 = self.git.NoOp()
+ self.assertEquals(git_version_2, git_command_version)
+
+ # reset to empty:
+ self.git.set_persistent_git_options()
+ self.assertRaises(GitCommandError, self.git.NoOp)
+
def test_single_char_git_options_are_passed_to_git(self):
input_value = 'TestValue'
output_value = self.git(c='user.name=%s' % input_value).config('--get', 'user.name')