(monkeypatch: MonkeyPatch)
| 386 | |
| 387 | @pytest.mark.skipif(not on_win, reason="windows-specific test") |
| 388 | def test_replace_prefix_in_path_2(monkeypatch: MonkeyPatch): |
| 389 | path1 = join("c:\\", "temp", "6663 31e0") |
| 390 | path2 = join("c:\\", "temp", "6663 31e0", "envs", "charizard") |
| 391 | one_more = join("d:\\", "one", "more") |
| 392 | # old_prefix: c:\users\builder\appdata\local\temp\6663 31e0 |
| 393 | # new_prefix: c:\users\builder\appdata\local\temp\6663 31e0\envs\charizard |
| 394 | activator = CmdExeActivator() |
| 395 | old_path = activator.pathsep_join(activator._add_prefix_to_path(path1)) |
| 396 | old_path = one_more + ";" + old_path |
| 397 | |
| 398 | monkeypatch.setenv("PATH", old_path) |
| 399 | activator = PosixActivator() |
| 400 | path_elements = activator._replace_prefix_in_path(path1, path2) |
| 401 | |
| 402 | assert path_elements[0] == win_path_to_unix(one_more) |
| 403 | assert path_elements[1] == win_path_to_unix(next(activator._get_path_dirs(path2))) |
| 404 | assert len(path_elements) == len(old_path.split(";")) |
| 405 | |
| 406 | |
| 407 | def test_default_env(tmp_path: Path): |
nothing calls this directly
no test coverage detected
searching dependent graphs…