def test_parse_http_protocol(): assert HTTP1Protocol._parse_http_protocol("HTTP/1.1") == (1, 1) assert HTTP1Protocol._parse_http_protocol("HTTP/0.0") == (0, 0) assert not HTTP1Protocol._parse_http_protocol("HTTP/a.1") assert not HTTP1Protocol._parse_http_protocol("HTTP/1.a") assert not HTTP1Protocol._parse_http_protocol("foo/0.0") assert not HTTP1Protocol._parse_http_protocol("HTTP/x")