-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Expand file tree
/
Copy pathtest_commands_package.py
More file actions
42 lines (32 loc) · 1.2 KB
/
test_commands_package.py
File metadata and controls
42 lines (32 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""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