コード例 #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
ファイル: test_funcs.py プロジェクト: imbolc/Leaf
def test_strip_linebreaks():
    assert leaf.strip_linebreaks("blah\n\n\n\ntest") == 'blah\ntest', "Strip excess line breaks from a string"
コード例 #3
0
ファイル: test_funcs.py プロジェクト: imbolc/Leaf
def test_strip_linebreaks():
    assert leaf.strip_linebreaks(
        "blah\n\n\n\ntest"
    ) == 'blah\ntest', "Strip excess line breaks from a string"