def test_source_with_hash_titles(src_hash_titles): marked = parse_marked(src_hash_titles) assert marked.title == 'title' assert 'meta' in marked.meta assert marked.short_description == 'short description' assert marked.sections[0] == ('sub1', 'sub text.', ()) assert marked.sections[1] == ('sub2', 'sub text.', ()) assert len(marked.sections) == 2
def test_parse_valid_document(src): marked = parse_marked(src) assert marked.title == 'Title' assert 'meta1' in marked.meta assert 'meta2' in marked.meta assert marked.short_description.startswith('Short description paragraph.') assert marked.short_description.endswith(';-)') assert len(marked.sections) == 2 assert marked.sections[0][0] == ('Subsection 1') assert marked.sections[1][0] == ('Subsection 2')
def test_valid_document_round_trip(src): marked = parse_marked(src) assert marked.source() == src
def marked_with_hashes(src_with_hashes): return parse_marked(src_hash_titles)
def marked(src): return parse_marked(src)