diff options
author | Anson Mansfield <anson.mansfield@gmail.com> | 2017-07-19 18:16:51 -0400 |
---|---|---|
committer | Anson Mansfield <anson.mansfield@gmail.com> | 2017-07-19 18:57:07 -0400 |
commit | 67260a382f3d4fb841fe4cb9c19cc6ca1ada26be (patch) | |
tree | fe7f7b109b6aaf6c93c810d19db6f61a68f4a9d3 /git/test/test_git.py | |
parent | cf8dc259fcc9c1397ea67cec3a6a4cb5816e3e68 (diff) | |
download | gitpython-67260a382f3d4fb841fe4cb9c19cc6ca1ada26be.tar.gz |
test if it accepts environment variables in commands
Diffstat (limited to 'git/test/test_git.py')
-rw-r--r-- | git/test/test_git.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/git/test/test_git.py b/git/test/test_git.py index 3c8b6f82..4c3afce9 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -105,6 +105,21 @@ class TestGit(TestBase): self.git.version(pass_this_kwarg=False) assert_true("pass_this_kwarg" not in git.call_args[1]) + def test_it_accepts_environment_variables(self): + filename = fixture_path("ls_tree_empty") + with open(filename, 'r') as fh: + tree = self.git.mktree(istream=fh) + env = { + 'GIT_AUTHOR_NAME': 'Author Name', + 'GIT_AUTHOR_EMAIL': 'author@example.com', + 'GIT_AUTHOR_DATE': '1400000000+0000', + 'GIT_COMMITTER_NAME': 'Committer Name', + 'GIT_COMMITTER_EMAIL': 'committer@example.com', + 'GIT_COMMITTER_DATE': '1500000000+0000', + } + commit = self.git.commit_tree(tree, m='message', env=env) + assert_equal(commit, '4cfd6b0314682d5a58f80be39850bad1640e9241') + def test_persistent_cat_file_command(self): # read header only import subprocess as sp |