示例#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_to_unicode():
    assert type(leaf.to_unicode("test")) == unicode
    assert type(leaf.to_unicode(u"blah")) == unicode
示例#3
0
文件: test_funcs.py 项目: imbolc/Leaf
def test_to_unicode():
    assert type(leaf.to_unicode("test")) == unicode
    assert type(leaf.to_unicode(u"blah")) == unicode
示例#4
0
文件: test_funcs.py 项目: jean/leaf
def test_to_unicode():
    assert isinstance(leaf.to_unicode("test"), text_type)
    assert isinstance(leaf.to_unicode(u"blah"), text_type)
    assert isinstance(leaf.to_unicode(b"blah"), text_type)
示例#5
0
def test_to_unicode():
    if sys.version_info == 3:
        assert type(leaf.to_unicode("test")) == text_type
    else:
        assert type(leaf.to_unicode("test")) == str
    assert type(leaf.to_unicode(u"blah")) == text_type
示例#6
0
文件: test_funcs.py 项目: ra2003/leaf
def test_to_unicode():
    assert isinstance(leaf.to_unicode("test"), text_type)
    assert isinstance(leaf.to_unicode(u"blah"), text_type)
    assert isinstance(leaf.to_unicode(b"blah"), text_type)