From 1ca475c19254ebb8e3c453bab8599c19305e45a5 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 1 Dec 2013 00:43:45 +0000 Subject: Add test to ensure whitespace at start of XML document is ignored --- mammoth/__init__.py | 5 +++++ tests/xmlparser_tests.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/mammoth/__init__.py b/mammoth/__init__.py index e69de29..803273f 100644 --- a/mammoth/__init__.py +++ b/mammoth/__init__.py @@ -0,0 +1,5 @@ +from .results import Result + + +def convert_to_html(fileobj): + return Result("", []) diff --git a/tests/xmlparser_tests.py b/tests/xmlparser_tests.py index 90d8d9b..33563dd 100644 --- a/tests/xmlparser_tests.py +++ b/tests/xmlparser_tests.py @@ -59,5 +59,11 @@ def namespace_of_attributes_is_mapped_to_prefix(): assert_equal("Hello!", xml.attributes["x:val"]) +@istest +def whitespace_between_xml_declaration_and_root_tag_is_ignored(): + xml = _parse_xml_string(b'\n') + assert_equal("body", xml.name) + + def _parse_xml_string(string, namespace_mapping=None): return parse_xml(io.BytesIO(string), namespace_mapping) -- cgit v1.2.3