diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2014-11-17 10:14:43 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2014-11-17 10:14:43 +0100 |
commit | e4d8fb73daa82420bdc69c37f0d58f7cb4cd505a (patch) | |
tree | 38e1241fd6d756f783b6b56dc6628ac3ca41ed4f /git/test/test_git.py | |
parent | 7aba59a2609ec768d5d495dafd23a4bce8179741 (diff) | |
parent | c8e70749887370a99adeda972cc3503397b5f9a7 (diff) | |
download | gitpython-e4d8fb73daa82420bdc69c37f0d58f7cb4cd505a.tar.gz |
Merge pull request #204 from hashar/pep8-linting
Pep8 linting
Diffstat (limited to 'git/test/test_git.py')
-rw-r--r-- | git/test/test_git.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/git/test/test_git.py b/git/test/test_git.py index 7132aa83..49c256ca 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -5,15 +5,16 @@ # the BSD License: http://www.opensource.org/licenses/bsd-license.php import os -from git.test.lib import ( TestBase, - patch, +from git.test.lib import (TestBase, + patch, raises, assert_equal, assert_true, assert_match, - fixture_path ) -from git import ( Git, - GitCommandError ) + fixture_path) +from git import (Git, + GitCommandError) + class TestGit(TestBase): @@ -41,7 +42,6 @@ class TestGit(TestBase): def test_it_raises_errors(self): self.git.this_does_not_exist() - def test_it_transforms_kwargs_into_git_command_arguments(self): assert_equal(["-s"], self.git.transform_kwargs(**{'s': True})) assert_equal(["-s5"], self.git.transform_kwargs(**{'s': 5})) @@ -52,7 +52,7 @@ class TestGit(TestBase): 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\.]{2}.*$', 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") @@ -71,13 +71,13 @@ class TestGit(TestBase): # read header only import subprocess as sp hexsha = "b2339455342180c7cc1e9bba3e9f181f7baa5167" - g = self.git.cat_file(batch_check=True, istream=sp.PIPE,as_process=True) + g = self.git.cat_file(batch_check=True, istream=sp.PIPE, as_process=True) g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n") g.stdin.flush() obj_info = g.stdout.readline() # read header + data - g = self.git.cat_file(batch=True, istream=sp.PIPE,as_process=True) + g = self.git.cat_file(batch=True, istream=sp.PIPE, as_process=True) g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n") g.stdin.flush() obj_info_two = g.stdout.readline() @@ -87,15 +87,14 @@ class TestGit(TestBase): size = int(obj_info.split()[2]) data = g.stdout.read(size) g.stdout.read(1) - + # now we should be able to read a new object g.stdin.write("b2339455342180c7cc1e9bba3e9f181f7baa5167\n") g.stdin.flush() assert g.stdout.readline() == obj_info - # same can be achived using the respective command functions - hexsha, typename, size = self.git.get_object_header(hexsha) + hexsha, typename, size = self.git.get_object_header(hexsha) hexsha, typename_two, size_two, data = self.git.get_object_data(hexsha) assert typename == typename_two and size == size_two @@ -123,7 +122,7 @@ class TestGit(TestBase): self.assertEquals(git_version, git_command_version) def test_single_char_git_options_are_passed_to_git(self): - input_value='TestValue' + input_value = 'TestValue' output_value = self.git(c='user.name={}'.format(input_value)).config('--get', 'user.name') self.assertEquals(input_value, output_value) |