Exemplo n.º 1
0
 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")
Exemplo n.º 2
0
 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")
Exemplo n.º 3
0
 def test_detect_transport_protocol(self, fetcher: TCPFetcher) -> None:
     assert fetcher._detect_transport_protocol(b"02", "Unused") == TransportProtocol.SHA256