test: make diary state path assertion platform-neutral

The Windows CI job failed on:

    assert '/.mempalace/state/' in str(state_path)

because Windows uses ``\`` as the path separator, so the substring
never matches. The behavior under test (state file lives outside the
diary dir, under ``~/.mempalace/state/``) is already correct on both
platforms — only the assertion was Unix-only.

Switch to ``state_path.parent`` comparisons that work on any OS.
This commit is contained in:
Igor Lins e Silva
2026-04-13 18:55:26 -03:00
parent d16de9fe69
commit 7192552624
+4 -1
View File
@@ -586,7 +586,10 @@ class TestDiaryIngest:
# State file does exist under ~/.mempalace/state/.
state_path = _state_file_for(str(palace_dir), diary_dir.resolve())
assert state_path.exists()
assert "/.mempalace/state/" in str(state_path)
# Platform-neutral path check: compare parents rather than a hardcoded
# separator string that would fail on Windows (``\.mempalace\state\``).
assert state_path.parent.name == "state"
assert state_path.parent.parent.name == ".mempalace"
def test_wing_prefixed_drawer_id_prevents_cross_diary_collision(self, tmp_path):
# Regression: the original implementation used