test(miner): compare default wing to normalized dirname, not raw name
test_load_config_uses_defaults_when_yaml_missing asserted the derived wing equals project_root.name. That only held when the random tempfile name had no separators; tempfile's alphabet includes '_', so once normalize_wing_name strips leading/trailing '_' (this PR), a name like 'tmpXXXX_' makes the derived wing diverge from the raw name. Compare against normalize_wing_name(project_root.name) — the actual contract — which is deterministic across platforms. (Surfaced as a test-windows failure on this PR, but it was cross-platform flaky.)
This commit is contained in:
parent
b5f3915d5b
commit
ab669fd3b1
|
|
@ -9,6 +9,7 @@ import chromadb
|
|||
import pytest
|
||||
import yaml
|
||||
|
||||
from mempalace.config import normalize_wing_name
|
||||
from mempalace.miner import detect_room, load_config, mine, scan_project, status
|
||||
from mempalace.palace import NORMALIZE_VERSION, file_already_mined, prefetch_mined_set
|
||||
|
||||
|
|
@ -257,7 +258,12 @@ def test_load_config_uses_defaults_when_yaml_missing():
|
|||
assert isinstance(config, dict)
|
||||
assert "wing" in config
|
||||
assert "rooms" in config
|
||||
assert config["wing"] == project_root.name
|
||||
# The default wing is the normalized dirname, not the raw name: temp
|
||||
# dir names can contain leading/trailing '_' (tempfile's alphabet
|
||||
# includes it), which normalize_wing_name strips. Comparing to the raw
|
||||
# name was flaky across platforms (it only passed when the random name
|
||||
# had no separators).
|
||||
assert config["wing"] == normalize_wing_name(project_root.name)
|
||||
finally:
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue