def test_parser_consume_fail(): p = Parser(b'data') with pytest.raises(ParseError): p.consume(rb'invalid')
def test_parser_consume_success(): p = Parser(b'data') result = p.consume(rb'data') assert result assert p.index == 4