"""The parts of the package that are plain constants, checked against the contract. These are the only tests here that do not depend on an implementation, which makes them the canary for the `unit` check's own wiring: if they fail, the package is not importable from the build sandbox and nothing else means anything. """ from __future__ import annotations import hhstream from hhstream import capture, client, protocol, server from conftest import CONTRACT_SOCKET def test_magic_matches_the_contract(): # docs/CONTRACT.md: {"magic":"HHS1", ...} assert hhstream.MAGIC == "HHS1" assert protocol.MAGIC == "HHS1" def test_default_socket_path_matches_the_contract(): assert server.DEFAULT_SOCKET == CONTRACT_SOCKET assert client.DEFAULT_SOCKET == CONTRACT_SOCKET def test_public_surface_is_present(): for name in ("hello", "parse_hello", "frame", "read_frame", "read_hello"): assert callable(getattr(protocol, name)), f"protocol.{name}" assert callable(client.fetch) assert callable(client.main) assert callable(server.main) assert isinstance(server.FrameServer, type) assert isinstance(capture.CommandCapture, type) def test_version_is_the_packaged_version(): assert hhstream.__version__ == "0.1.0"