예제 #1
0
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
예제 #2
0
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
예제 #3
0
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')
예제 #4
0
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')
예제 #5
0
def test_valid_document_round_trip(src):
    marked = parse_marked(src)
    assert marked.source() == src
예제 #6
0
def marked_with_hashes(src_with_hashes):
    return parse_marked(src_hash_titles)
예제 #7
0
def marked(src):
    return parse_marked(src)
예제 #8
0
def test_valid_document_round_trip(src):
    marked = parse_marked(src)
    assert marked.source() == src
예제 #9
0
def marked_with_hashes(src_with_hashes):
    return parse_marked(src_hash_titles)
예제 #10
0
def marked(src):
    return parse_marked(src)