def test_conversion(self): md = 'Hello _[World](http://example.com/)!_' rst = 'Hello *`World <http://example.com/>`_!*' html = '<p>Hello <em><a href="http://example.com/">World</a>!</em></p>' try: import html2text except ImportError: raise SkipTest try: import html2rest except ImportError: try: helpers.system(['which', 'pandoc']) except: raise SkipTest else: raise SkipTest assert imprt.convert(html, fmt='Markdown') == (md, 'markdown') assert imprt.convert(html, fmt='reStructuredText') == (rst, 'rst') assert imprt.convert(html, fmt='HTML') == (html, 'html') assert imprt.convert('', fmt='Markdown') == ('', 'markdown') assert imprt.convert(None, fmt='Markdown') == ('', 'markdown')
def conversion(self): md = 'Hello _[World](http://example.com/)!_' rst = 'Hello *`World <http://example.com/>`_!*' html = '<p>Hello <em><a href="http://example.com/">World</a>!</em></p>' try: import html2text except ImportError: return try: import html2rest except ImportError: try: helpers.system(['which', 'pandoc']) except: return else: return assert imprt.convert(html, fmt='Markdown') == (md, 'markdown') assert imprt.convert(html, fmt='reStructuredText') == (rst, 'rst') assert imprt.convert(html, fmt='HTML') == (html, 'html') assert imprt.convert('', fmt='Markdown') == ('', 'markdown') assert imprt.convert(None, fmt='Markdown') == ('', 'markdown')
def test_conversion(self): md = 'Hello _[World](http://example.com/)!_' rst = 'Hello *`World <http://example.com/>`_!*' html = '<p>Hello <em><a href="http://example.com/">World</a>!</em></p>' try: import html2text except ImportError: raise SkipTest assert imprt.convert(html, fmt='Markdown') == (md, 'markdown') # assert imprt.convert(html, fmt='reStructuredText') == (rst, 'rst') assert imprt.convert(html, fmt='HTML') == (html, 'html') assert imprt.convert('', fmt='Markdown') == ('', 'markdown') assert imprt.convert(None, fmt='Markdown') == ('', 'markdown')