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.
42 lines
1011 B
Python
42 lines
1011 B
Python
"""Regression guard: console symbols must remain importable from specify_cli."""
|
|
from specify_cli import (
|
|
console,
|
|
StepTracker,
|
|
select_with_arrows,
|
|
)
|
|
|
|
|
|
def test_console_symbols_importable():
|
|
from rich.console import Console
|
|
assert isinstance(console, Console)
|
|
|
|
|
|
def test_console_symbols_available_from_star_import():
|
|
namespace = {}
|
|
exec("from specify_cli import *", namespace)
|
|
|
|
for symbol in (
|
|
"console",
|
|
"StepTracker",
|
|
"get_key",
|
|
"select_with_arrows",
|
|
"BannerGroup",
|
|
"show_banner",
|
|
"BANNER",
|
|
"TAGLINE",
|
|
):
|
|
assert symbol in namespace
|
|
|
|
|
|
def test_step_tracker_instantiable():
|
|
tracker = StepTracker("test")
|
|
tracker.add("step1", "Step One")
|
|
tracker.complete("step1", "done")
|
|
assert tracker.steps[0]["status"] == "done"
|
|
|
|
|
|
def test_select_with_arrows_raises_on_empty_options():
|
|
import pytest
|
|
with pytest.raises(ValueError, match="at least one option"):
|
|
select_with_arrows({})
|