Exemplo n.º 1
0
def test_parse_front_matter_only():
    """Should not care about any other --- lines."""
    lines = StringIO(dedent("""
        ---
        dude: abiding
        walter: angry
        ---

        Art
        ---

        Maude's thing.
    """))
    yaml, md = parse_md_front_matter(lines)
    eq_(yaml, 'dude: abiding\nwalter: angry\n')
    eq_(md, "\nArt\n---\n\nMaude's thing.\n")
Exemplo n.º 2
0
def test_parse_front_matter_only():
    """Should not care about any other --- lines."""
    lines = StringIO(
        dedent("""
        ---
        dude: abiding
        walter: angry
        ---

        Art
        ---

        Maude's thing.
    """))
    yaml, md = parse_md_front_matter(lines)
    eq_(yaml, 'dude: abiding\nwalter: angry\n')
    eq_(md, "\nArt\n---\n\nMaude's thing.\n")
Exemplo n.º 3
0
def test_parse_front_matter():
    """Should return front matter and MD separately."""
    lines = StringIO(dedent("""
        ---
        dude: abiding
        walter: angry
        donny: oblivious
        ---

        Let's go bowling.
    """))
    yaml, md = parse_md_front_matter(lines)
    eq_(yaml, dedent("""\
        dude: abiding
        walter: angry
        donny: oblivious
    """))
    eq_(md, "\nLet's go bowling.\n")
Exemplo n.º 4
0
def test_parse_front_matter():
    """Should return front matter and MD separately."""
    lines = StringIO(
        dedent("""
        ---
        dude: abiding
        walter: angry
        donny: oblivious
        ---

        Let's go bowling.
    """))
    yaml, md = parse_md_front_matter(lines)
    assert yaml == dedent("""\
        dude: abiding
        walter: angry
        donny: oblivious
    """)
    assert md == "\nLet's go bowling.\n"