Example #1
0
    def test_assert_header_parsing_no_error_on_multipart(self):
        from http import client

        header_msg = io.BytesIO()
        header_msg.write(
            b'Content-Type: multipart/encrypted;protocol="application/'
            b'HTTP-SPNEGO-session-encrypted";boundary="Encrypted Boundary"'
            b"\nServer: Microsoft-HTTPAPI/2.0\nDate: Fri, 16 Aug 2019 19:28:01 GMT"
            b"\nContent-Length: 1895\n\n\n")
        header_msg.seek(0)
        assert_header_parsing(client.parse_headers(header_msg))
Example #2
0
 def test_assert_header_parsing_throws_typeerror_with_non_headers(self, headers):
     with pytest.raises(TypeError):
         assert_header_parsing(headers)
Example #3
0
 def test_assert_header_parsing_throws_typeerror_with_non_headers(
         self, headers):
     with pytest.raises(TypeError):
         assert_header_parsing(headers)
Example #4
0
 def test_assert_header_parsing_throws_typeerror_with_non_headers(
         self, headers: Optional[Union[bytes, object]]) -> None:
     with pytest.raises(TypeError):
         assert_header_parsing(headers)  # type: ignore[arg-type]