Skip to content

Commit 0cf47ae

Browse files
committed
tests/cli(test[add]): update for ./ preservation behavior
why: Automatic ./ migration removed; test should verify ./ sections are preserved. what: - Rename test_handle_add_command_upgrades_dot_workspace_section - Update test to verify existing ./ sections are preserved - Change assertions to expect ./ label when matching existing section refs: Remove ./ migration behavior
1 parent a5424e2 commit 0cf47ae

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tests/cli/test_add.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,12 +1021,12 @@ def test_handle_add_command_workspace_label_variants(
10211021
assert "./" not in config_data
10221022

10231023

1024-
def test_handle_add_command_upgrades_dot_workspace_section(
1024+
def test_handle_add_command_preserves_existing_dot_workspace_section(
10251025
tmp_path: pathlib.Path,
10261026
monkeypatch: MonkeyPatch,
10271027
caplog: t.Any,
10281028
) -> None:
1029-
"""Existing './' sections should be relabeled to their tilde equivalent."""
1029+
"""Existing './' sections should be preserved when they match the workspace."""
10301030
caplog.set_level(logging.INFO)
10311031

10321032
monkeypatch.setenv("HOME", str(tmp_path))
@@ -1066,13 +1066,9 @@ def test_handle_add_command_upgrades_dot_workspace_section(
10661066

10671067
handle_add_command(args)
10681068

1069-
expected_label = "~/study/python/"
1070-
assert expected_label in caplog.text
1071-
10721069
with config_file.open(encoding="utf-8") as fh:
10731070
config_data = yaml.safe_load(fh) or {}
10741071

1075-
assert expected_label in config_data
1076-
assert "./" not in config_data
1077-
assert "existing" in config_data[expected_label]
1078-
assert "pytest-docker" in config_data[expected_label]
1072+
assert "./" in config_data
1073+
assert "existing" in config_data["./"]
1074+
assert "pytest-docker" in config_data["./"]

0 commit comments

Comments
 (0)