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
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)
def test_Html2Text_basic(): assert template.html2text('<h3>hello</h3>') == '### hello'
def test_basic(self): assert_equals(template.html2text('<h3>hello</h3>'), '### hello')