# Copyright (c) 2026 Krzysztof Rudnicki. MIT licence. """The transport seam. Both implementations are checked against the same Protocol here, which is what makes "the fake and the real adapter are interchangeable" a fact the suite enforces rather than a claim in a docstring. """ from __future__ import annotations from typing import TYPE_CHECKING import httpx from signal_bot.transport_base import Transport from signal_bot.transport_fake import FakeTransport from signal_bot.transport_rest import RestTransport if TYPE_CHECKING: from signal_bot.config import Config def test_fake_transport_satisfies_the_protocol() -> None: assert isinstance(FakeTransport(), Transport) def test_rest_transport_satisfies_the_protocol(config: Config) -> None: assert isinstance(RestTransport(config, httpx.AsyncClient()), Transport) def test_protocol_names_the_whole_surface() -> None: for name in ( "receive", "send_text", "send_image", "list_attachments", "fetch_attachment", "delete_attachment", ): assert hasattr(Transport, name)