36 lines
1 KiB
Python
36 lines
1 KiB
Python
|
|
"""Smoke tests asserting the scaffold imports cleanly."""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typer.testing import CliRunner
|
||
|
|
|
||
|
|
import artifactstore
|
||
|
|
from artifactstore.api.http import app as http_app
|
||
|
|
from artifactstore.cli import app as cli_app
|
||
|
|
from artifactstore.config import Settings, get_settings
|
||
|
|
|
||
|
|
|
||
|
|
def test_package_version_exposed() -> None:
|
||
|
|
assert isinstance(artifactstore.__version__, str)
|
||
|
|
assert artifactstore.__version__
|
||
|
|
|
||
|
|
|
||
|
|
def test_http_app_root_route_registered() -> None:
|
||
|
|
routes = {getattr(r, "path", None) for r in http_app.routes}
|
||
|
|
assert "/" in routes
|
||
|
|
|
||
|
|
|
||
|
|
def test_cli_version_command_round_trips() -> None:
|
||
|
|
runner = CliRunner()
|
||
|
|
result = runner.invoke(cli_app, ["version"])
|
||
|
|
assert result.exit_code == 0, result.output
|
||
|
|
assert artifactstore.__version__ in result.output
|
||
|
|
|
||
|
|
|
||
|
|
def test_settings_defaults_loadable() -> None:
|
||
|
|
settings = get_settings()
|
||
|
|
assert isinstance(settings, Settings)
|
||
|
|
assert settings.log_level
|
||
|
|
assert settings.database_url
|
||
|
|
assert settings.storage_local_root
|