Merge pull request #630 from PR0M3TH3AN/codex/add-typer-command-for-beeware-gui

Add GUI command
This commit is contained in:
thePR0M3TH3AN
2025-07-18 11:03:09 -04:00
committed by GitHub
2 changed files with 24 additions and 0 deletions

View File

@@ -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()

View File

@@ -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