"""Test the error hierarchy."""
from __future__ import annotations

import pytest

from ai_mouse import errors


def test_model_load_error_is_aimouse_error() -> None:
    assert issubclass(errors.ModelLoadError, errors.AiMouseError)


def test_generation_error_is_aimouse_error() -> None:
    assert issubclass(errors.GenerationError, errors.AiMouseError)


def test_can_catch_specific_with_general() -> None:
    with pytest.raises(errors.AiMouseError):
        raise errors.ModelLoadError("test")
