mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-27 07:52:03 +00:00
Derive two TUI path expectations from Path instead of hardcoding POSIX
Two of the four Windows TUI failures are literal `/tmp/...` comparisons against paths the app echoes as the platform renders them — on Windows "\tmp\seedpass-db-export.enc", which no POSIX literal will ever match. The expected strings now come from Path, which is a no-op on Linux and macOS (verified: all 91 tests in both files still pass locally) and correct on Windows. The other two are left red on purpose. One raises FileNotFoundError reading back an `export-field nsec` target that was never written; the other asserts False after `doc-export`. Both depend on palette argument parsing and file writing on Windows, which I cannot reproduce here — and a fix I cannot run is a guess dressed as a change. They are named in TODO.md instead. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Vtx94nXDmNgXEeThUZP4QN
This commit is contained in:
1 parent
01960e9234
commit
c52104da38
3 files changed
+32
-20
No files matched your search
@@ -253,22 +253,26 @@ everything still open, in the order it should be tackled.
|
||||
deliberately with the sync round-trip re-validated against a real
|
||||
relay rather than folded into unrelated work.
|
||||
(Found 2026-08-20 on the first CI run of this branch.)
|
||||
- [ ] **Four TUI tests fail on Windows, and only Windows ever runs
|
||||
them.** Surfaced 2026-08-20 once the Tests workflow could report
|
||||
a Windows failure at all (see below). All four assume POSIX
|
||||
paths: `test_tui2_textual_palette_profiles_and_settings` and
|
||||
`test_tui3_change_password_and_seed_backup_flows_use_vault_service`
|
||||
compare against literal `/tmp/...` strings while the app echoes
|
||||
the platform-normalized `\tmp\...`;
|
||||
`test_tui2_textual_copy_command_for_core_and_advanced_fields`
|
||||
dies with FileNotFoundError on an `export-field` target; and
|
||||
`test_tui2_textual_palette_notes_tags_fields_and_doc_export`
|
||||
asserts False on a doc-export path.
|
||||
- [ ] **Two TUI tests still fail on Windows, and only Windows ever runs
|
||||
them.** Surfaced 2026-08-20 once the Tests workflow could report a
|
||||
Windows failure at all (see below). Four failed; two were literal
|
||||
`/tmp/...` comparisons against paths the app echoes
|
||||
platform-normalized, and those are fixed by deriving the expected
|
||||
string from `Path` — a no-op on POSIX, verified locally.
|
||||
|
||||
They are left failing rather than patched blind: reproducing them
|
||||
needs a Windows host, and guessing at path-normalization and
|
||||
palette-argument parsing would mean changing tests to match an
|
||||
assumption instead of a behaviour.
|
||||
The remaining two need a Windows host and are deliberately not
|
||||
patched blind:
|
||||
|
||||
- `test_tui2_textual_copy_command_for_core_and_advanced_fields`
|
||||
raises FileNotFoundError reading back an `export-field nsec`
|
||||
target that was never written.
|
||||
- `test_tui2_textual_palette_notes_tags_fields_and_doc_export`
|
||||
asserts False after `doc-export`.
|
||||
|
||||
Both depend on palette argument parsing and file writing on
|
||||
Windows. Guessing at either would mean changing a test to match an
|
||||
assumption rather than a behaviour, so they are left red and
|
||||
named.
|
||||
|
||||
Note how this interacts with the textual item below: because
|
||||
textual is undeclared, these tests SKIP on Linux and macOS and run
|
||||
|
||||
@@ -2657,15 +2657,20 @@ async def test_tui2_textual_profiles_and_settings_palette_commands() -> None:
|
||||
await pilot.pause()
|
||||
assert "Exported TOTP entries to" in _status_text(app)
|
||||
|
||||
# The app echoes the path as the platform renders it, so derive the
|
||||
# expected text from Path rather than hardcoding the POSIX form --
|
||||
# on Windows this string is "\\tmp\\seedpass-db-export.enc" and the
|
||||
# literal comparison failed there while passing everywhere else.
|
||||
db_path = Path("/tmp/seedpass-db-export.enc")
|
||||
app._run_palette_command("db-export /tmp/seedpass-db-export.enc")
|
||||
await pilot.pause()
|
||||
assert Path("/tmp/seedpass-db-export.enc") in vault.exported
|
||||
assert "Database exported to /tmp/seedpass-db-export.enc" in _status_text(app)
|
||||
assert db_path in vault.exported
|
||||
assert f"Database exported to {db_path}" in _status_text(app)
|
||||
|
||||
app._run_palette_command("db-import /tmp/seedpass-db-export.enc")
|
||||
await pilot.pause()
|
||||
assert Path("/tmp/seedpass-db-export.enc") in vault.imported
|
||||
assert "Database imported from /tmp/seedpass-db-export.enc" in _status_text(app)
|
||||
assert db_path in vault.imported
|
||||
assert f"Database imported from {db_path}" in _status_text(app)
|
||||
|
||||
app._run_palette_command(
|
||||
"parent-seed-backup /tmp/seedpass-parent-backup.enc pass123"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
@@ -662,9 +663,11 @@ async def test_tui3_change_password_and_seed_backup_flows_use_vault_service() ->
|
||||
await pilot.pause()
|
||||
assert vault.changed_passwords == [("old-pass", "new-pass")]
|
||||
|
||||
# The processor normalizes the path through Path, so compare against
|
||||
# the platform's rendering of it rather than the POSIX literal.
|
||||
app.processor.execute("backup-parent-seed /tmp/seed-backup.enc pw123")
|
||||
await pilot.pause()
|
||||
assert vault.backup_requests[-1] == ("/tmp/seed-backup.enc", "pw123")
|
||||
assert vault.backup_requests[-1] == (str(Path("/tmp/seed-backup.enc")), "pw123")
|
||||
|
||||
app.processor.execute("backup-parent-seed")
|
||||
await pilot.pause()
|
||||
|
||||
Reference in new issue
Block a user