mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
Merge pull request #630 from PR0M3TH3AN/codex/add-typer-command-for-beeware-gui
Add GUI command
This commit is contained in:
@@ -682,5 +682,13 @@ def api_stop(ctx: typer.Context, host: str = "127.0.0.1", port: int = 8000) -> N
|
||||
typer.echo(f"Failed to stop server: {exc}")
|
||||
|
||||
|
||||
@app.command()
|
||||
def gui() -> None:
|
||||
"""Launch the BeeWare GUI."""
|
||||
from seedpass_gui.app import main
|
||||
|
||||
main()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app()
|
||||
|
@@ -532,3 +532,19 @@ def test_tui_forward_fingerprint(monkeypatch):
|
||||
result = runner.invoke(app, ["--fingerprint", "abc"])
|
||||
assert result.exit_code == 0
|
||||
assert called.get("fp") == "abc"
|
||||
|
||||
|
||||
def test_gui_command(monkeypatch):
|
||||
called = {}
|
||||
|
||||
def fake_main():
|
||||
called["called"] = True
|
||||
|
||||
monkeypatch.setitem(
|
||||
sys.modules,
|
||||
"seedpass_gui.app",
|
||||
SimpleNamespace(main=fake_main),
|
||||
)
|
||||
result = runner.invoke(app, ["gui"])
|
||||
assert result.exit_code == 0
|
||||
assert called.get("called") is True
|
||||
|
Reference in New Issue
Block a user