"""Shared fixtures for the test suite.""" import base64 import pytest from neotalk.core.entities.identity import Identity from tests.fakes import FakeCrypto @pytest.fixture def crypto() -> FakeCrypto: return FakeCrypto() @pytest.fixture def shared_key(crypto: FakeCrypto) -> bytes: return crypto.derive_shared_key(b"peer-public-key") @pytest.fixture def identity() -> Identity: return Identity( peer_id="local-id", alias="ana", public_key=b"local-public-key", tcp_port=50600, ) @pytest.fixture def hello_datagram() -> dict: return { "v": 1, "type": "hello", "peer_id": "remote-id", "alias": "bob", "tcp_port": 50601, "pubkey": base64.b64encode(b"remote-public-key").decode("ascii"), }