"""Tests for the public package-level API."""
from __future__ import annotations


def test_public_symbols_importable() -> None:
    from ai_mouse import (
        MouseModel,
        ScrollModel,
        generate,
        generate_scroll,
        errors,
    )
    assert MouseModel is not None
    assert ScrollModel is not None
    assert callable(generate)
    assert callable(generate_scroll)
    assert hasattr(errors, "ModelLoadError")


def test_generate_function_returns_list_of_tuples() -> None:
    from ai_mouse import generate
    pts = generate((100, 100), (300, 200))
    assert isinstance(pts, list)
    assert len(pts) > 0
    assert isinstance(pts[0], tuple)
    assert len(pts[0]) == 3


def test_generate_singleton_reused() -> None:
    from ai_mouse import generate
    from ai_mouse import _model_cache
    _model_cache._get_mouse_model.cache_clear()
    generate((0, 0), (100, 100))
    info_after_first = _model_cache._get_mouse_model.cache_info()
    generate((0, 0), (200, 200))
    info_after_second = _model_cache._get_mouse_model.cache_info()
    assert info_after_second.hits > info_after_first.hits


def test_version_present() -> None:
    import ai_mouse
    assert hasattr(ai_mouse, "__version__")
    assert isinstance(ai_mouse.__version__, str)
