Files
account-manager/tests/test_usage.py
chendelian e441b0c58e
All checks were successful
技能自动化发布 / release (push) Successful in 5s
feat: account ensure-web (pick-or-create for first-run UX)
2026-07-18 14:37:16 +08:00

36 lines
874 B
Python

# -*- coding: utf-8 -*-
"""Smoke test: built-in CLI usage lists routed account subcommands."""
from __future__ import annotations
import os
import subprocess
import sys
import pytest
_scripts = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "scripts")
def test_usage_includes_all_account_subcommands():
env = {**os.environ, "PYTHONPATH": _scripts}
r = subprocess.run(
[sys.executable, "-m", "cli.app"],
capture_output=True,
text=True,
env=env,
cwd=_scripts,
)
assert r.returncode == 1
usage = r.stdout
for cmd in (
"init-master-key",
"export-credentials",
"import-credentials",
"add-web",
"ensure-web",
"get-credential",
"pick-web",
):
assert cmd in usage, f"USAGE 缺少 {cmd}"
assert "--ensure" in usage