acupedia-ops/tests/bootstrap/test_api_cli.py

23 lines
632 B
Python

from pathlib import Path
import pytest
from acupedia_ops.bootstrap.api_cli import resolve_api_root, run_api_bootstrap
def test_resolve_api_root(tmp_path: Path) -> None:
api = tmp_path / "api"
(api / "app").mkdir(parents=True)
(api / "pyproject.toml").write_text("", encoding="utf-8")
assert resolve_api_root(api) == api.resolve()
def test_rejects_unknown_target(tmp_path: Path) -> None:
api = tmp_path / "api"
(api / "app").mkdir(parents=True)
(api / "pyproject.toml").write_text("", encoding="utf-8")
with pytest.raises(ValueError):
run_api_bootstrap(target="unknown", api_root=api)