"""Tier-0 smoke — build-broken detector.

Minimal post-install sanity: the package imports, its public surface is
present, the frame types construct, and the error hierarchy is intact.
No fixtures, no I/O. If this fails, the wheel is broken.
"""

from __future__ import annotations

import pytest

pytestmark = pytest.mark.smoke


def test_public_surface_importable() -> None:
    import mgf.tele.core as m

    expected = {
        "GeoPoint",
        "ParseStatus",
        "DecodedAvlRecord",
        "ReceivedPacket",
        "TelematicsProvider",
        "SessionHandle",
        "TelematicsError",
    }
    assert expected <= set(m.__all__)


def test_geopoint_constructs() -> None:
    from mgf.tele.core import GeoPoint

    pt = GeoPoint(lat=33.3, lon=44.4)
    assert pt.lat == 33.3


def test_error_hierarchy_roots_at_telematics_error() -> None:
    from mgf.tele.core import (
        ChecksumError,
        MalformedPacketError,
        TelematicsError,
    )

    assert issubclass(MalformedPacketError, TelematicsError)
    assert issubclass(ChecksumError, TelematicsError)
