40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
"""Package + probe smoke tests (no services required)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
from thicket import __version__
|
|
|
|
|
|
def test_version_string():
|
|
assert isinstance(__version__, str)
|
|
assert __version__.count(".") == 2
|
|
|
|
|
|
def test_version_matches_pyproject():
|
|
pyproject = Path(__file__).resolve().parents[1] / "pyproject.toml"
|
|
match = re.search(r'^version = "(.+)"$', pyproject.read_text(), re.M)
|
|
assert match is not None, "pyproject version line missing"
|
|
assert match.group(1) == __version__
|
|
|
|
|
|
def test_env_probe_reports_module_table():
|
|
from thicket.env_probe import PROBED_MODULES, probe_environment
|
|
|
|
env = probe_environment(qdrant_host="localhost", qdrant_port=1) # dead port
|
|
assert set(env.modules.keys()) == set(PROBED_MODULES.keys())
|
|
assert all(isinstance(v, bool) for v in env.modules.values())
|
|
# known-good modules on this interpreter
|
|
assert env.modules["pypdf"] is True
|
|
assert env.modules["slugify"] is True
|
|
|
|
|
|
def test_ui_modules_import_without_heavy_deps():
|
|
# GUI must import on a bare system (heavy deps are lazy).
|
|
import thicket.ui_theme # noqa: F401
|
|
import thicket.ui_window # noqa: F401
|
|
import thicket.widgets
|
|
assert hasattr(thicket.widgets, "RadioKnob")
|