Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddb4417

Browse files
committed
Improve consistency of "END" comments in test suite
As in the recent roughly corresponding change inside git/, this does not add new END comments (and actually removes some), but instead focuses on making the existing ones more consistent in style, mainly adjusting capitalization (turning "end" to "END").
1 parent c2eb6b5 commit ddb4417

9 files changed

+17
-25
lines changed

test/performance/lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def setUp(self):
4545
k_env_git_repo,
4646
)
4747
repo_path = osp.dirname(__file__)
48-
# end set some repo path
48+
# END set some repo path
4949
self.gitrorepo = Repo(repo_path, odbt=GitCmdObjectDB, search_parent_directories=True)
5050
self.puregitrorepo = Repo(repo_path, odbt=GitDB, search_parent_directories=True)
5151

test/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,5 @@ def test_add_unicode(self, rw_repo):
142142
else:
143143
# On POSIX, we can just add Unicode files without problems.
144144
rw_repo.git.add(rw_repo.working_dir)
145-
# end
145+
146146
rw_repo.index.commit("message")

test/test_config.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,9 @@ def test_config_include(self, rw_dir):
190190
def write_test_value(cw, value):
191191
cw.set_value(value, "value", value)
192192

193-
# end
194-
195193
def check_test_value(cr, value):
196194
assert cr.get_value(value, "value") == value
197195

198-
# end
199-
200196
# PREPARE CONFIG FILE A
201197
fpa = osp.join(rw_dir, "a")
202198
with GitConfigParser(fpa, read_only=False) as cw:
@@ -225,7 +221,7 @@ def check_test_value(cr, value):
225221
with GitConfigParser(fpa, read_only=True) as cr:
226222
for tv in ("a", "b", "c"):
227223
check_test_value(cr, tv)
228-
# end for each test to verify
224+
# END for each test to verify
229225
assert len(cr.items("include")) == 8, "Expected all include sections to be merged"
230226

231227
# Test writable config writers - assure write-back doesn't involve includes.

test/test_diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def test_diff_index(self):
223223
for dr in res:
224224
self.assertTrue(dr.diff.startswith(b"@@"), dr)
225225
self.assertIsNotNone(str(dr), "Diff to string conversion should be possible")
226-
# end for each diff
226+
# END for each diff
227227

228228
dr = res[3]
229229
assert dr.diff.endswith(b"+Binary files a/rps and b/rps differ\n")

test/test_docs.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ def update(self, op_code, cur_count, max_count=None, message=""):
146146
message or "NO MESSAGE",
147147
)
148148

149-
# end
150-
151149
self.assertEqual(len(cloned_repo.remotes), 1) # We have been cloned, so should be one remote.
152150
self.assertEqual(len(bare_repo.remotes), 0) # This one was just initialized.
153151
origin = bare_repo.create_remote("origin", url=cloned_repo.working_tree_dir)

test/test_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ def mixed_iterator():
635635
)
636636

637637
os.remove(link_file)
638-
# end for each target
638+
# END for each target
639639
# END real symlink test
640640

641641
# Add fake symlink and assure it checks-our as symlink.

test/test_remote.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,7 @@ def test_base(self, rw_repo, remote_repo):
518518
if branch.name != "master":
519519
branch.delete(remote_repo, branch, force=True)
520520
num_deleted += 1
521-
# end
522-
# end for each branch
521+
# END for each branch
523522
self.assertGreater(num_deleted, 0)
524523
self.assertEqual(
525524
len(rw_repo.remotes.origin.fetch(prune=True)),

test/test_repo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def test_untracked_files(self, rwrepo):
790790

791791
repo_add(untracked_files)
792792
self.assertEqual(len(rwrepo.untracked_files), (num_recently_untracked - len(files)))
793-
# end for each run
793+
# END for each run
794794

795795
def test_config_reader(self):
796796
reader = self.rorepo.config_reader() # All config files.
@@ -1165,8 +1165,8 @@ def last_commit(repo, rev, path):
11651165
for repo_type in (GitCmdObjectDB, GitDB):
11661166
repo = Repo(self.rorepo.working_tree_dir, odbt=repo_type)
11671167
last_commit(repo, "master", "test/test_base.py")
1168-
# end for each repository type
1169-
# end for each iteration
1168+
# END for each repository type
1169+
# END for each iteration
11701170

11711171
def test_remote_method(self):
11721172
self.assertRaises(ValueError, self.rorepo.remote, "foo-blue")
@@ -1227,7 +1227,7 @@ def test_merge_base(self):
12271227
res = repo.merge_base(c1, c2, c3, **{kw: True})
12281228
self.assertIsInstance(res, list)
12291229
self.assertEqual(len(res), 1)
1230-
# end for each keyword signalling all merge-bases to be returned
1230+
# END for each keyword signalling all merge-bases to be returned
12311231

12321232
# Test for no merge base - can't do as we have.
12331233
self.assertRaises(GitCommandError, repo.merge_base, c1, "ffffff")

test/test_submodule.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def test_first_submodule(self, rwrepo):
704704
sm = rwrepo.create_submodule(sm_name, sm_path, rwrepo.git_dir, no_checkout=True)
705705
assert sm.exists() and sm.module_exists()
706706
rwrepo.index.commit("Added submodule " + sm_name)
707-
# end for each submodule path to add
707+
# END for each submodule path to add
708708

709709
self.assertRaises(ValueError, rwrepo.create_submodule, "fail", osp.expanduser("~"))
710710
self.assertRaises(
@@ -731,7 +731,7 @@ def test_add_empty_repo(self, rwdir):
731731
url=empty_repo_dir,
732732
no_checkout=checkout_mode and True or False,
733733
)
734-
# end for each checkout mode
734+
# END for each checkout mode
735735

736736
@with_rw_directory
737737
@_patch_git_config("protocol.file.allow", "always")
@@ -783,8 +783,8 @@ def test_git_submodules_and_add_sm_with_new_commit(self, rwdir):
783783
for init in (False, True):
784784
sm.update(init=init)
785785
sm2.update(init=init)
786-
# end for each init state
787-
# end for each iteration
786+
# END for each init state
787+
# END for each iteration
788788

789789
sm.move(sm.path + "_moved")
790790
sm2.move(sm2.path + "_moved")
@@ -839,7 +839,7 @@ def assert_exists(sm, value=True):
839839
assert sm.exists() == value
840840
assert sm.module_exists() == value
841841

842-
# end
842+
# END def assert_exists
843843

844844
# As git is backwards compatible itself, it would still recognize what we do here... unless we really
845845
# muss it up. That's the only reason why the test is still here...
@@ -854,7 +854,7 @@ def assert_exists(sm, value=True):
854854
assert osp.isfile(module_repo_path)
855855
assert sm.module().has_separate_working_tree()
856856
assert find_submodule_git_dir(module_repo_path) is not None, "module pointed to by .git file must be valid"
857-
# end verify submodule 'style'
857+
# END verify submodule 'style'
858858

859859
# Test move.
860860
new_sm_path = join_path_native("submodules", "one")
@@ -911,7 +911,7 @@ def assert_exists(sm, value=True):
911911
sm.remove(dry_run=dry_run, force=True)
912912
assert_exists(sm, value=dry_run)
913913
assert osp.isdir(sm_module_path) == dry_run
914-
# end for each dry-run mode
914+
# END for each dry-run mode
915915

916916
@with_rw_directory
917917
def test_ignore_non_submodule_file(self, rwdir):
@@ -974,7 +974,6 @@ def test_rename(self, rwdir):
974974
sm_mod = sm.module()
975975
if osp.isfile(osp.join(sm_mod.working_tree_dir, ".git")) == sm._need_gitfile_submodules(parent.git):
976976
assert sm_mod.git_dir.endswith(join_path_native(".git", "modules", new_sm_name))
977-
# end
978977

979978
@with_rw_directory
980979
def test_branch_renames(self, rw_dir):

0 commit comments

Comments
 (0)