Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3a34dee

Browse files
committed
Also test refresh with an already-absolute bad path
1 parent24d6067 commit3a34dee

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

‎test/test_git.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,16 +306,23 @@ def test_cmd_override(self):
306306
):
307307
self.assertRaises(GitCommandNotFound,self.git.version)
308308

309-
deftest_refresh_bad_git_path(self):
310-
path="yada"
311-
escaped_abspath=re.escape(str(Path(path).absolute()))
312-
expected_pattern=rf"\n[ \t]*cmdline:{escaped_abspath}\Z"
309+
deftest_refresh_bad_absolute_git_path(self):
310+
absolute_path=str(Path("yada").absolute())
311+
expected_pattern=rf"\n[ \t]*cmdline:{re.escape(absolute_path)}\Z"
313312
withself.assertRaisesRegex(GitCommandNotFound,expected_pattern):
314-
refresh(path)
313+
refresh(absolute_path)
315314

316-
deftest_refresh_good_git_path(self):
317-
path=shutil.which("git")
318-
refresh(path)
315+
deftest_refresh_bad_relative_git_path(self):
316+
relative_path="yada"
317+
absolute_path=str(Path(relative_path).absolute())
318+
expected_pattern=rf"\n[ \t]*cmdline:{re.escape(absolute_path)}\Z"
319+
withself.assertRaisesRegex(GitCommandNotFound,expected_pattern):
320+
refresh(relative_path)
321+
322+
deftest_refresh_good_absolute_git_path(self):
323+
absolute_path=shutil.which("git")
324+
refresh(absolute_path)
325+
self.assertEqual(self.git.GIT_PYTHON_GIT_EXECUTABLE,absolute_path)
319326

320327
deftest_options_are_passed_to_git(self):
321328
# This works because any command after git --version is ignored.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp