881bc8a1bf
- pyproject.toml with uv, deps for runtime + gui + backtest + dev - ruff/mypy strict config, pre-commit hooks for ruff/mypy/pytest - src/cerbero_bite/ layout with empty modules ready for Phase 1+ - structlog JSONL logger with daily rotation - click CLI with placeholder subcommands (status, start, kill-switch, gui, replay, config hash, audit verify) - 6 smoke tests passing, mypy --strict clean, ruff clean Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
56 lines
1.5 KiB
Python
56 lines
1.5 KiB
Python
"""Smoke tests: package importable, version exposed, CLI invokable."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from click.testing import CliRunner
|
|
|
|
import cerbero_bite
|
|
from cerbero_bite import __version__
|
|
from cerbero_bite.cli import main as cli_main
|
|
|
|
|
|
def test_package_version_string() -> None:
|
|
assert isinstance(__version__, str)
|
|
assert __version__.count(".") == 2
|
|
|
|
|
|
def test_package_module_attribute() -> None:
|
|
assert cerbero_bite.__version__ == __version__
|
|
|
|
|
|
def test_cli_help_lists_status_command() -> None:
|
|
runner = CliRunner()
|
|
result = runner.invoke(cli_main, ["--help"])
|
|
assert result.exit_code == 0
|
|
assert "status" in result.output
|
|
|
|
|
|
def test_cli_status_runs(tmp_data_dir: Path) -> None:
|
|
runner = CliRunner()
|
|
result = runner.invoke(
|
|
cli_main,
|
|
["--log-dir", str(tmp_data_dir / "log"), "status"],
|
|
)
|
|
assert result.exit_code == 0
|
|
assert "Cerbero Bite" in result.output
|
|
assert "phase: 0" in result.output
|
|
|
|
|
|
def test_cli_kill_switch_arm_placeholder(tmp_data_dir: Path) -> None:
|
|
runner = CliRunner()
|
|
result = runner.invoke(
|
|
cli_main,
|
|
["--log-dir", str(tmp_data_dir / "log"), "kill-switch", "arm", "--reason", "test"],
|
|
)
|
|
assert result.exit_code == 0
|
|
assert "phase 0 placeholder" in result.output
|
|
|
|
|
|
def test_cli_version_flag() -> None:
|
|
runner = CliRunner()
|
|
result = runner.invoke(cli_main, ["--version"])
|
|
assert result.exit_code == 0
|
|
assert __version__ in result.output
|