@@ -34,6 +34,7 @@ | |||
| 34 | 34 | LockFile, | |
| 35 | 35 | cygpath, | |
| 36 | 36 | decygpath, | |
| 37 | + is_cygwin_git, | ||
| 37 | 38 | get_user_id, | |
| 38 | 39 | remove_password_if_present, | |
| 39 | 40 | rmtree, | |
@@ -349,6 +350,24 @@ def test_decygpath(self, wpath, cpath): | |||
| 349 | 350 | assert wcpath == wpath.replace("/", "\\"), cpath | |
| 350 | 351 | ||
| 351 | 352 | ||
| 353 | + class TestIsCygwinGit: | ||
| 354 | + """Tests for :func:`is_cygwin_git`""" | ||
| 355 | + | ||
| 356 | + def test_on_path_executable(self): | ||
| 357 | + match sys.platform: | ||
| 358 | + case "cygwin": | ||
| 359 | + assert is_cygwin_git("git") | ||
| 360 | + case _: | ||
| 361 | + assert not is_cygwin_git("git") | ||
| 362 | + | ||
| 363 | + def test_none_executable(self): | ||
| 364 | + assert not is_cygwin_git(None) | ||
| 365 | + | ||
| 366 | + def test_with_missing_uname(self): | ||
| 367 | + """Test for handling when `uname` isn't in the same directory as `git`""" | ||
| 368 | + assert not is_cygwin_git("/bogus_path/git") | ||
| 369 | + | ||
| 370 | + | ||
| 352 | 371 | class _Member: | |
| 353 | 372 | """A member of an IterableList.""" | |
| 354 | 373 | ||
0 commit comments