fix: restore build-profile cli surface
This commit is contained in:
parent
ac9616080b
commit
a0522c316e
@ -1,12 +1,19 @@
|
||||
import typer
|
||||
|
||||
app = typer.Typer(help="Build one canonical candidate profile YAML")
|
||||
|
||||
|
||||
@app.callback()
|
||||
def main_command() -> None:
|
||||
pass
|
||||
|
||||
@app.command("build-profile")
|
||||
def build_profile() -> None:
|
||||
"""Build candidate-profile.yaml from CV and markdown profile."""
|
||||
|
||||
|
||||
def main() -> None:
|
||||
typer.run(build_profile)
|
||||
app()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
from subprocess import run
|
||||
|
||||
|
||||
def test_installed_cli_help_exposes_single_root_command() -> None:
|
||||
def test_installed_cli_help_exposes_build_profile_subcommand() -> None:
|
||||
result = run(["uv", "run", "job-research", "--help"], capture_output=True, text=True, check=False)
|
||||
|
||||
assert result.returncode == 0
|
||||
assert "build-profile" not in result.stdout
|
||||
assert "build-profile" in result.stdout
|
||||
assert "Build candidate-profile.yaml from CV and markdown profile." in result.stdout
|
||||
|
||||
|
||||
def test_installed_cli_rejects_build_profile_subcommand() -> None:
|
||||
result = run(["uv", "run", "job-research", "build-profile"], capture_output=True, text=True, check=False)
|
||||
def test_installed_cli_subcommand_help_works() -> None:
|
||||
result = run(["uv", "run", "job-research", "build-profile", "--help"], capture_output=True, text=True, check=False)
|
||||
|
||||
assert result.returncode != 0
|
||||
assert "unexpected extra argument" in result.stderr.lower()
|
||||
assert result.returncode == 0
|
||||
assert "Usage: job-research build-profile" in result.stdout
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user