File tree 1 file changed +15
-8
lines changed
1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -306,16 +306,23 @@ def test_cmd_override(self):
306
306
):
307
307
self .assertRaises (GitCommandNotFound , self .git .version )
308
308
309
- def test_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
+ def test_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"
313
312
with self .assertRaisesRegex (GitCommandNotFound , expected_pattern ):
314
- refresh (path )
313
+ refresh (absolute_path )
315
314
316
- def test_refresh_good_git_path (self ):
317
- path = shutil .which ("git" )
318
- refresh (path )
315
+ def test_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
+ with self .assertRaisesRegex (GitCommandNotFound , expected_pattern ):
320
+ refresh (relative_path )
321
+
322
+ def test_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 )
319
326
320
327
def test_options_are_passed_to_git (self ):
321
328
# This works because any command after git --version is ignored.
You can’t perform that action at this time.
0 commit comments