def test_parse_with_too_much_data(self): p = Parser(bytearray(b'\x00\x00')) cert_type = ServerCertTypeExtension() with self.assertRaises(SyntaxError): cert_type.parse(p)