|
5 | 5 | import pathlib |
6 | 6 | import typing as t |
7 | 7 |
|
8 | | -from vcspull.util import contract_user_home, get_config_dir |
| 8 | +from vcspull.util import get_config_dir |
9 | 9 |
|
10 | 10 | if t.TYPE_CHECKING: |
11 | 11 | import pytest |
@@ -37,42 +37,3 @@ def test_vcspull_configdir_no_xdg(monkeypatch: pytest.MonkeyPatch) -> None: |
37 | 37 | """Test retrieving config directory without XDG_CONFIG_HOME set.""" |
38 | 38 | monkeypatch.delenv("XDG_CONFIG_HOME") |
39 | 39 | assert get_config_dir() |
40 | | - |
41 | | - |
42 | | -def test_contract_user_home_contracts_home_path() -> None: |
43 | | - """Test contracting home directory to ~.""" |
44 | | - home = str(pathlib.Path.home()) |
45 | | - |
46 | | - # Test full path |
47 | | - assert contract_user_home(f"{home}/code/repo") == "~/code/repo" |
48 | | - |
49 | | - # Test home directory itself |
50 | | - assert contract_user_home(home) == "~" |
51 | | - |
52 | | - # Test with pathlib.Path |
53 | | - assert contract_user_home(pathlib.Path(home) / "code" / "repo") == "~/code/repo" |
54 | | - |
55 | | - |
56 | | -def test_contract_user_home_preserves_non_home_paths() -> None: |
57 | | - """Test that non-home paths are not contracted.""" |
58 | | - # Test absolute paths outside home |
59 | | - assert contract_user_home("/opt/project") == "/opt/project" |
60 | | - assert contract_user_home("/usr/local/bin") == "/usr/local/bin" |
61 | | - |
62 | | - # Test relative paths |
63 | | - assert contract_user_home("./relative/path") == "./relative/path" |
64 | | - assert contract_user_home("relative/path") == "relative/path" |
65 | | - |
66 | | - |
67 | | -def test_contract_user_home_handles_edge_cases() -> None: |
68 | | - """Test edge cases in path contraction.""" |
69 | | - home = str(pathlib.Path.home()) |
70 | | - |
71 | | - # Test trailing slashes |
72 | | - assert contract_user_home(f"{home}/code/") == "~/code/" |
73 | | - |
74 | | - # Test empty path |
75 | | - assert contract_user_home("") == "" |
76 | | - |
77 | | - # Test path with ~ already in it (should pass through) |
78 | | - assert contract_user_home("~/code/repo") == "~/code/repo" |
0 commit comments