mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-06 12:52:04 +00:00
cli: restore legacy launch compatibility and fix tui v2 header rendering
This commit is contained in:
1 parent
a4de52ae4a
commit
8e3aaa8653
3 files changed
+52
-7
No files matched your search
@@ -156,3 +156,39 @@ def test_main_fingerprint_option(monkeypatch):
|
||||
rc = main.main(["--fingerprint", "abc", "search", "q"])
|
||||
assert rc == 0
|
||||
assert called.get("fp") == "abc"
|
||||
|
||||
|
||||
def test_legacy_command_compatibility(monkeypatch):
|
||||
called = {"menu": False}
|
||||
|
||||
monkeypatch.setattr(main, "PasswordManager", lambda *a, **k: make_pm([]))
|
||||
monkeypatch.setattr(main, "configure_logging", lambda: None)
|
||||
monkeypatch.setattr(main, "initialize_app", lambda: None)
|
||||
monkeypatch.setattr(main.signal, "signal", lambda *a, **k: None)
|
||||
monkeypatch.setattr(
|
||||
main,
|
||||
"display_menu",
|
||||
lambda *a, **k: called.__setitem__("menu", True),
|
||||
)
|
||||
|
||||
rc = main.main(["legacy"])
|
||||
assert rc == 0
|
||||
assert called["menu"] is True
|
||||
|
||||
|
||||
def test_legacy_flag_compatibility(monkeypatch):
|
||||
called = {"menu": False}
|
||||
|
||||
monkeypatch.setattr(main, "PasswordManager", lambda *a, **k: make_pm([]))
|
||||
monkeypatch.setattr(main, "configure_logging", lambda: None)
|
||||
monkeypatch.setattr(main, "initialize_app", lambda: None)
|
||||
monkeypatch.setattr(main.signal, "signal", lambda *a, **k: None)
|
||||
monkeypatch.setattr(
|
||||
main,
|
||||
"display_menu",
|
||||
lambda *a, **k: called.__setitem__("menu", True),
|
||||
)
|
||||
|
||||
rc = main.main(["--legacy-tui"])
|
||||
assert rc == 0
|
||||
assert called["menu"] is True
|
||||
Reference in new issue
Block a user