def test_detect_transport_protocol_error(self, fetcher: TCPFetcher) -> None: with pytest.raises(MKFetcherError, match="Unknown transport protocol: b'abc'"): fetcher._detect_transport_protocol(b"abc", "unused")
def test_detect_transport_protocol_empty_error(self, fetcher: TCPFetcher) -> None: with pytest.raises(MKFetcherError, match="Passed error message"): fetcher._detect_transport_protocol(b"", "Passed error message")
def test_detect_transport_protocol(self, fetcher: TCPFetcher) -> None: assert fetcher._detect_transport_protocol(b"02", "Unused") == TransportProtocol.SHA256