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

Minimal post-install sanity: the package imports, its public surface is
present, and the dependency-free pieces construct. No fixtures, no I/O,
sub-millisecond. If this fails, the wheel is broken; don't bother running
the rest of the suite.
"""

from __future__ import annotations

import pytest

pytestmark = pytest.mark.smoke


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

    expected = {
        "Broker",
        "Subscription",
        "MockBroker",
        "RedisBroker",
        "SlotCap",
        "SSEStream",
        "SSEStreamService",
        "sse_headers",
        "LivePushError",
        "CapExceededError",
    }
    assert expected <= set(m.__all__)


def test_mock_broker_constructs() -> None:
    from mgf.livepush import MockBroker

    assert MockBroker() is not None


def test_errors_subclass_base() -> None:
    from mgf.livepush import CapExceededError, LivePushError

    assert issubclass(CapExceededError, LivePushError)
