コード例 #1
0
ファイル: test_template.py プロジェクト: JNRowe/hubugs
def test_Html2Text_width():
    para = """<p>This is a long paragraph that needs wrapping to work so it
    doesn’t make you want to claw your eyes out."""
    assert template.html2text(para).count('\n') == 1
    # FIXME: Recent html2text version have changed API
    if isinstance(h2t_version, str) and h2t_version <= '2014.4.5':
        assert template.html2text(para, width=20).count('\n') == 1
コード例 #2
0
ファイル: test_template.py プロジェクト: sorin-ionescu/hubugs
 def test_width(self):
     para = """<p>This is a long paragraph that needs wrapping to work so it
     doesn't make you want to claw your eyes out."""
     assert_equals(template.html2text(para).count('\n'), 1)
     assert_equals(template.html2text(para, width=20).count('\n'), 5)
コード例 #3
0
ファイル: test_template.py プロジェクト: JNRowe/hubugs
def test_Html2Text_basic():
    assert template.html2text('<h3>hello</h3>') == '### hello'
コード例 #4
0
ファイル: test_template.py プロジェクト: sorin-ionescu/hubugs
 def test_basic(self):
     assert_equals(template.html2text('<h3>hello</h3>'), '### hello')