Ejemplo n.º 1
0
def test_bbcode():
    document = leaf.parse(sample)
    bbcode = document.parse(bbcode_formatter, 'http://example.com/')
    bbcode = leaf.strip_spaces(bbcode)
    bbcode = leaf.strip_symbols(bbcode)
    bbcode = leaf.strip_linebreaks(bbcode)

    assert bbcode == leaf.to_unicode(sample_result), "Sample bbcode formatter"
Ejemplo n.º 2
0
def test_strip_spaces():
    assert leaf.strip_spaces('   blah    sdsdf a         adddd d         ') == 'blah sdsdf a adddd d', "Strip excess spaces from a string"
Ejemplo n.º 3
0
def test_strip_spaces():
    assert leaf.strip_spaces(
        '   blah    sdsdf a         adddd d         '
    ) == 'blah sdsdf a adddd d', "Strip excess spaces from a string"