fix: align candidate profile CLI contract
This commit is contained in:
parent
4b2ce3b465
commit
ac9616080b
@ -1,15 +1,12 @@
|
||||
import typer
|
||||
|
||||
app = typer.Typer(help="Build one canonical candidate profile YAML")
|
||||
|
||||
|
||||
@app.command("build-profile")
|
||||
def build_profile() -> None:
|
||||
"""Build candidate-profile.yaml from CV and markdown profile."""
|
||||
|
||||
|
||||
def main() -> None:
|
||||
app()
|
||||
typer.run(build_profile)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -1,10 +1,16 @@
|
||||
from typer.testing import CliRunner
|
||||
|
||||
from job_research.cli import app
|
||||
from subprocess import run
|
||||
|
||||
|
||||
def test_cli_help_exposes_single_build_command() -> None:
|
||||
result = CliRunner().invoke(app, ["--help"])
|
||||
def test_installed_cli_help_exposes_single_root_command() -> None:
|
||||
result = run(["uv", "run", "job-research", "--help"], capture_output=True, text=True, check=False)
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "build-profile" in result.stdout
|
||||
assert result.returncode == 0
|
||||
assert "build-profile" not 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)
|
||||
|
||||
assert result.returncode != 0
|
||||
assert "unexpected extra argument" in result.stderr.lower()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user