mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 12:28:06 +08:00
Clear pre-existing lint debt flagged by repo-wide `ruff check` (the lint config only scopes src/, so tests/ had drifted). No behavior change. - F401/F541: drop unused imports and redundant f-string prefixes (autofix) - E741: rename ambiguous `l` to `ln` in comprehensions - E702: split semicolon-joined statements onto separate lines - F841: drop unused bindings while keeping the side-effecting calls (_minimal_feature, install_from_directory) Full suite: 3344 passed, 40 skipped. ruff check (repo-wide): clean.
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
"""Tests for the commands/ package structure."""
|
|
import importlib
|
|
|
|
|
|
def test_commands_package_importable():
|
|
mod = importlib.import_module("specify_cli.commands")
|
|
assert mod is not None
|
|
|
|
|
|
def test_commands_init_importable():
|
|
mod = importlib.import_module("specify_cli.commands.init")
|
|
assert hasattr(mod, "register")
|
|
assert callable(mod.register)
|
|
|
|
|
|
def test_agent_config_importable():
|
|
from specify_cli._agent_config import (
|
|
AGENT_CONFIG,
|
|
AI_ASSISTANT_ALIASES,
|
|
AI_ASSISTANT_HELP,
|
|
DEFAULT_INIT_INTEGRATION,
|
|
SCRIPT_TYPE_CHOICES,
|
|
)
|
|
assert isinstance(AGENT_CONFIG, dict)
|
|
assert isinstance(AI_ASSISTANT_ALIASES, dict)
|
|
assert isinstance(AI_ASSISTANT_HELP, str)
|
|
assert DEFAULT_INIT_INTEGRATION == "copilot"
|
|
assert "sh" in SCRIPT_TYPE_CHOICES
|
|
|
|
|
|
def test_agent_config_re_exported_from_init():
|
|
from specify_cli import AGENT_CONFIG, SCRIPT_TYPE_CHOICES
|
|
assert isinstance(AGENT_CONFIG, dict)
|
|
assert "sh" in SCRIPT_TYPE_CHOICES
|
|
|
|
|
|
def test_init_command_registered():
|
|
from specify_cli import app
|
|
callback_names = [
|
|
cmd.callback.__name__ for cmd in app.registered_commands if cmd.callback
|
|
]
|
|
assert "init" in callback_names
|