コード例 #1
0
def test_exception_timing():
    result = parse_filterlist(['! good line', '%bad line%'])
    assert next(result) == Comment('good line')
    with pytest.raises(ParseError):
        next(result)
コード例 #2
0
def test_parse_filterlist():
    result = parse_filterlist(['! foo', '! Title: bar'])
    assert list(result) == [Comment('foo'), Metadata('Title', 'bar')]