Test UTF-8 problems raise appropriate exceptions.
Cory Benfield
8 years ago
503 | 503 | # The status header shouldn't be indexed. |
504 | 504 | assert len(d.header_table.dynamic_entries) == len(expect) - 1 |
505 | 505 | |
506 | def test_utf8_errors_raise_hpack_decoding_error(self): | |
507 | d = Decoder() | |
508 | ||
509 | # Invalid UTF-8 data. | |
510 | data = b'\x82\x86\x84\x01\x10www.\x07\xaa\xd7\x95\xd7\xa8\xd7\x94.com' | |
511 | ||
512 | with pytest.raises(HPACKDecodingError): | |
513 | d.decode(data) | |
514 | ||
506 | 515 | |
507 | 516 | class TestIntegerEncoding(object): |
508 | 517 | # These tests are stolen from the HPACK spec. |