Пример #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"
Пример #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"
Пример #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"