Ignore:
Timestamp:
14 Dec 2014, 16:01:35 (10 years ago)
Author:
Henrik Bettermann
Message:

Add helper function html2dict.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_helpers.py

    r11824 r12231  
    582582        info = helpers.get_meminfo(src="nOt-ExIsTiNg-FiLe")
    583583        assert info is None
     584
     585
     586class Html2dictTestCase(unittest.TestCase):
     587
     588    def test_html2dict(self):
     589        assert helpers.html2dict(None) == {}
     590        assert helpers.html2dict() == {}
     591        assert helpers.html2dict(9) == {}
     592        assert helpers.html2dict('Hello world') == {
     593            'en': u'<div id="html">Hello world</div id="html">'}
     594        assert helpers.html2dict('Hello world>>de<<Hallo Welt') == {
     595            'de': u'<div id="html">Hallo Welt</div id="html">',
     596            'en': u'<div id="html">Hello world</div id="html">'}
    584597
    585598
     
    603616        MemInfoTestCase,
    604617        GetMemInfoTestCase,
     618        Html2dictTestCase,
    605619        ]:
    606620        suite.addTests(
Note: See TracChangeset for help on using the changeset viewer.