Ignore:
Timestamp:
14 Dec 2014, 15:56:45 (10 years ago)
Author:
Henrik Bettermann
Message:

Add unit test for helper function.

File:
1 edited

Legend:

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

    r11949 r12230  
    582582        info = helpers.get_meminfo(src="nOt-ExIsTiNg-FiLe")
    583583        assert info is None
     584
     585class Html2dictTestCase(unittest.TestCase):
     586
     587    def test_html2dict(self):
     588        assert helpers.html2dict(None) == {}
     589        assert helpers.html2dict() == {}
     590        assert helpers.html2dict(9) == {}
     591        assert helpers.html2dict('Hello world') == {
     592            'en': u'<div id="html">Hello world</div id="html">'}
     593        assert helpers.html2dict('Hello world>>de<<Hallo Welt') == {
     594            'de': u'<div id="html">Hallo Welt</div id="html">',
     595            'en': u'<div id="html">Hello world</div id="html">'}
    584596
    585597
     
    603615        MemInfoTestCase,
    604616        GetMemInfoTestCase,
     617        Html2dictTestCase,
    605618        ]:
    606619        suite.addTests(
Note: See TracChangeset for help on using the changeset viewer.