diff options
Diffstat (limited to 'lulua')
-rw-r--r-- | lulua/test_text.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lulua/test_text.py b/lulua/test_text.py index cd8ae7a..75673cb 100644 --- a/lulua/test_text.py +++ b/lulua/test_text.py @@ -19,9 +19,10 @@ # THE SOFTWARE. import brotli -from io import BytesIO +from io import BytesIO, StringIO +import html5lib -from .text import charMap, mapChars, BrotliFile +from .text import charMap, mapChars, BrotliFile, HTMLSerializer def test_map_chars_mapped (): """ Make sure all chars in the map are mapped correctly """ @@ -58,3 +59,12 @@ def test_brotlifile (): s = f.read () assert s == b'ello world' +def test_htmlserialized (): + document = html5lib.parse (StringIO ("""<html><body> +<p>Hello & World!</p> +</body></html>""")) + walker = html5lib.getTreeWalker("etree") + stream = walker (document) + s = HTMLSerializer() + assert ''.join (s.serialize(stream)) == ' Hello & World!\n\n ' + |