diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-05-23 01:34:08 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-05-23 01:40:11 +0800 |
commit | eb7941e3e6e92bac26f5d21525fc8ac89c934abe (patch) | |
tree | 8eae588751968cb8293de55b1957d4cecbdcc8dc /test | |
parent | db3b8b2103099a8859402f2167d7ad1a8fa66829 (diff) |
[compat] Fix for XML with <!DOCTYPE> in Python 2.7 and 3.2
Such XML documents cause DeprecationWarning if python is run
with `-W error`
Diffstat (limited to 'test')
-rw-r--r-- | test/test_compat.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_compat.py b/test/test_compat.py index 539b30540..f5317ac3e 100644 --- a/test/test_compat.py +++ b/test/test_compat.py @@ -103,6 +103,12 @@ class TestCompat(unittest.TestCase): self.assertTrue(isinstance(doc.find('chinese').text, compat_str)) self.assertTrue(isinstance(doc.find('foo/bar').text, compat_str)) + def test_compat_etree_fromstring_doctype(self): + xml = '''<?xml version="1.0"?> +<!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/2001/SMIL20/SMIL20.dtd"> +<smil xmlns="http://www.w3.org/2001/SMIL20/Language"></smil>''' + compat_etree_fromstring(xml) + def test_struct_unpack(self): self.assertEqual(compat_struct_unpack('!B', b'\x00'), (0,)) |