From f1b8d0c92e4b5797b95948bdb95bec7756f5189f Mon Sep 17 00:00:00 2001 From: Benjamin Poldrack Date: Tue, 18 Oct 2016 16:07:54 +0200 Subject: Add a test for persistent git options --- git/test/test_git.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'git/test/test_git.py') diff --git a/git/test/test_git.py b/git/test/test_git.py index bd8ebee2..ef327c6d 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') -- cgit v1.2.1 From bf8ce9464987c7b0dbe6acbc2cc2653e98ec739a Mon Sep 17 00:00:00 2001 From: Benjamin Poldrack Date: Wed, 19 Oct 2016 12:56:57 +0200 Subject: Fix flake8 error --- git/test/test_git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/test/test_git.py') diff --git a/git/test/test_git.py b/git/test/test_git.py index ef327c6d..14c70e18 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -172,7 +172,7 @@ class TestGit(TestBase): # reset to empty: self.git.set_persistent_git_options() - self.assertRaises(GitCommandError, self.git.NoOp) + self.assertRaises(GitCommandError, self.git.NoOp) def test_single_char_git_options_are_passed_to_git(self): input_value = 'TestValue' -- cgit v1.2.1