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 --- tests/xmlparser_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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