From f5d11b750ecc982541d1f936488248f0b42d75d3 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:15:50 +0100 Subject: pep8 linting (whitespaces) W191 indentation contains tabs E221 multiple spaces before operator E222 multiple spaces after operator E225 missing whitespace around operator E271 multiple spaces after keyword W292 no newline at end of file W293 blank line contains whitespace W391 blank line at end of file --- git/test/test_base.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'git/test/test_base.py') diff --git a/git/test/test_base.py b/git/test/test_base.py index 5edc9c52..d867242c 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -16,17 +16,17 @@ from gitdb.util import hex_to_bin import tempfile class TestBase(TestBase): - + type_tuples = ( ("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070", "blob.py"), ("tree", "3a6a5e3eeed3723c09f1ef0399f81ed6b8d82e79", "directory"), ("commit", "4251bd59fb8e11e40c40548cba38180a9536118c", None), ("tag", "e56a60e8e9cd333cfba0140a77cd12b0d9398f10", None) ) - + def test_base_object(self): # test interface of base object classes types = (Blob, Tree, Commit, TagObject) assert len(types) == len(self.type_tuples) - + s = set() num_objs = 0 num_index_objs = 0 @@ -47,52 +47,52 @@ class TestBase(TestBase): assert str(item) == item.hexsha assert repr(item) s.add(item) - + if isinstance(item, base.IndexObject): num_index_objs += 1 if hasattr(item,'path'): # never runs here assert not item.path.startswith("/") # must be relative assert isinstance(item.mode, int) # END index object check - + # read from stream data_stream = item.data_stream data = data_stream.read() assert data - + tmpfile = os.tmpfile() assert item == item.stream_data(tmpfile) tmpfile.seek(0) assert tmpfile.read() == data # END stream to file directly # END for each object type to create - + # each has a unique sha assert len(s) == num_objs assert len(s|s) == num_objs assert num_index_objs == 2 - + def test_get_object_type_by_name(self): for tname in base.Object.TYPES: assert base.Object in get_object_type_by_name(tname).mro() # END for each known type - + assert_raises( ValueError, get_object_type_by_name, "doesntexist" ) def test_object_resolution(self): # objects must be resolved to shas so they compare equal assert self.rorepo.head.reference.object == self.rorepo.active_branch.object - + @with_rw_repo('HEAD', bare=True) def test_with_bare_rw_repo(self, bare_rw_repo): assert bare_rw_repo.config_reader("repository").getboolean("core", "bare") assert os.path.isfile(os.path.join(bare_rw_repo.git_dir,'HEAD')) - + @with_rw_repo('0.1.6') def test_with_rw_repo(self, rw_repo): assert not rw_repo.config_reader("repository").getboolean("core", "bare") assert os.path.isdir(os.path.join(rw_repo.working_tree_dir,'lib')) - + @with_rw_and_rw_remote_repo('0.1.6') def test_with_rw_remote_and_rw_repo(self, rw_repo, rw_remote_repo): assert not rw_repo.config_reader("repository").getboolean("core", "bare") -- cgit v1.2.3 From be34ec23c48d6d5d8fd2ef4491981f6fb4bab8e6 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:51:04 +0100 Subject: pep8 linting (blank lines expectations) E301 expected 1 blank line, found 0 E302 expected 2 blank lines, found 1 E303 too many blank lines (n) --- git/test/test_base.py | 1 + 1 file changed, 1 insertion(+) (limited to 'git/test/test_base.py') diff --git a/git/test/test_base.py b/git/test/test_base.py index d867242c..42b95b39 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -15,6 +15,7 @@ from git.objects.util import get_object_type_by_name from gitdb.util import hex_to_bin import tempfile + class TestBase(TestBase): type_tuples = ( ("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070", "blob.py"), -- cgit v1.2.3 From 614907b7445e2ed8584c1c37df7e466e3b56170f Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:56:53 +0100 Subject: pep8 linting (whitespace before/after) E201 whitespace after '(' E202 whitespace before ')' E203 whitespace before ':' E225 missing whitespace around operator E226 missing whitespace around arithmetic operator E227 missing whitespace around bitwise or shift operator E228 missing whitespace around modulo operator E231 missing whitespace after ',' E241 multiple spaces after ',' E251 unexpected spaces around keyword / parameter equals --- git/test/test_base.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'git/test/test_base.py') diff --git a/git/test/test_base.py b/git/test/test_base.py index 42b95b39..211c7479 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -18,10 +18,10 @@ import tempfile class TestBase(TestBase): - type_tuples = ( ("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070", "blob.py"), + type_tuples = (("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070", "blob.py"), ("tree", "3a6a5e3eeed3723c09f1ef0399f81ed6b8d82e79", "directory"), ("commit", "4251bd59fb8e11e40c40548cba38180a9536118c", None), - ("tag", "e56a60e8e9cd333cfba0140a77cd12b0d9398f10", None) ) + ("tag", "e56a60e8e9cd333cfba0140a77cd12b0d9398f10", None)) def test_base_object(self): # test interface of base object classes @@ -35,9 +35,9 @@ class TestBase(TestBase): binsha = hex_to_bin(hexsha) item = None if path is None: - item = obj_type(self.rorepo,binsha) + item = obj_type(self.rorepo, binsha) else: - item = obj_type(self.rorepo,binsha, 0, path) + item = obj_type(self.rorepo, binsha, 0, path) # END handle index objects num_objs += 1 assert item.hexsha == hexsha @@ -51,7 +51,7 @@ class TestBase(TestBase): if isinstance(item, base.IndexObject): num_index_objs += 1 - if hasattr(item,'path'): # never runs here + if hasattr(item, 'path'): # never runs here assert not item.path.startswith("/") # must be relative assert isinstance(item.mode, int) # END index object check @@ -70,7 +70,7 @@ class TestBase(TestBase): # each has a unique sha assert len(s) == num_objs - assert len(s|s) == num_objs + assert len(s | s) == num_objs assert num_index_objs == 2 def test_get_object_type_by_name(self): @@ -78,7 +78,7 @@ class TestBase(TestBase): assert base.Object in get_object_type_by_name(tname).mro() # END for each known type - assert_raises( ValueError, get_object_type_by_name, "doesntexist" ) + assert_raises(ValueError, get_object_type_by_name, "doesntexist") def test_object_resolution(self): # objects must be resolved to shas so they compare equal @@ -87,15 +87,15 @@ class TestBase(TestBase): @with_rw_repo('HEAD', bare=True) def test_with_bare_rw_repo(self, bare_rw_repo): assert bare_rw_repo.config_reader("repository").getboolean("core", "bare") - assert os.path.isfile(os.path.join(bare_rw_repo.git_dir,'HEAD')) + assert os.path.isfile(os.path.join(bare_rw_repo.git_dir, 'HEAD')) @with_rw_repo('0.1.6') def test_with_rw_repo(self, rw_repo): assert not rw_repo.config_reader("repository").getboolean("core", "bare") - assert os.path.isdir(os.path.join(rw_repo.working_tree_dir,'lib')) + assert os.path.isdir(os.path.join(rw_repo.working_tree_dir, 'lib')) @with_rw_and_rw_remote_repo('0.1.6') def test_with_rw_remote_and_rw_repo(self, rw_repo, rw_remote_repo): assert not rw_repo.config_reader("repository").getboolean("core", "bare") assert rw_remote_repo.config_reader("repository").getboolean("core", "bare") - assert os.path.isdir(os.path.join(rw_repo.working_tree_dir,'lib')) + assert os.path.isdir(os.path.join(rw_repo.working_tree_dir, 'lib')) -- cgit v1.2.3 From c8e70749887370a99adeda972cc3503397b5f9a7 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 21:09:47 +0100 Subject: pep8 linting (trailing whitespace) W291 trailing whitespace --- git/test/test_base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'git/test/test_base.py') diff --git a/git/test/test_base.py b/git/test/test_base.py index 211c7479..81e785ab 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -18,12 +18,12 @@ import tempfile class TestBase(TestBase): - type_tuples = (("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070", "blob.py"), + type_tuples = (("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070", "blob.py"), ("tree", "3a6a5e3eeed3723c09f1ef0399f81ed6b8d82e79", "directory"), ("commit", "4251bd59fb8e11e40c40548cba38180a9536118c", None), - ("tag", "e56a60e8e9cd333cfba0140a77cd12b0d9398f10", None)) + ("tag", "e56a60e8e9cd333cfba0140a77cd12b0d9398f10", None)) - def test_base_object(self): + def test_base_object(self): # test interface of base object classes types = (Blob, Tree, Commit, TagObject) assert len(types) == len(self.type_tuples) @@ -76,7 +76,7 @@ class TestBase(TestBase): def test_get_object_type_by_name(self): for tname in base.Object.TYPES: assert base.Object in get_object_type_by_name(tname).mro() - # END for each known type + # END for each known type assert_raises(ValueError, get_object_type_by_name, "doesntexist") -- cgit v1.2.3