From e273a32ec727700d592723c4e5905510c71ed632 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 8 Dec 2014 17:01:44 +0100 Subject: Improve the xhtml_to_poezio_colors sanitization add some tests, and remove the test_datetime_tuple because of python time module misbehavior with timezones set manually. (potentially due to http://bugs.python.org/issue6478) --- test/test_xhtml.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/test_xhtml.py') diff --git a/test/test_xhtml.py b/test/test_xhtml.py index 58857d67..5afd08ff 100644 --- a/test/test_xhtml.py +++ b/test/test_xhtml.py @@ -38,6 +38,14 @@ def test_xhtml_to_poezio_colors(): xhtml = start + b'http://perdu.com' + end assert xhtml_to_poezio_colors(xhtml) == '\x19uhttp://perdu.com\x19o' + xhtml = b'
Allo
test
test2
' + assert xhtml_to_poezio_colors(xhtml, force=True) == '\x19bAllo \x19196}test \x1921}test2\x19o' + + xhtml = (b'
' + b'
Allo
' + b'test
test2
') + assert xhtml_to_poezio_colors(xhtml, force=True) == '\x1921}Allo \x19196}test \x1921}test2\x19o' + with pytest.raises(xml.sax._exceptions.SAXParseException): xhtml_to_poezio_colors(b'

Invalid xml') -- cgit v1.2.3