summaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests.py')
-rw-r--r--tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index f9dbfff..ccdf49b 100644
--- a/tests.py
+++ b/tests.py
@@ -188,6 +188,10 @@ class TestDefusedElementTree(BaseTests):
tree = self.module.fromstring(xmlstring, **kwargs)
return self.module.tostring(tree)
+ def parseStringList(self, sequence, **kwargs):
+ tree = self.module.fromstringlist(sequence, **kwargs)
+ return self.module.tostring(tree)
+
def iterparse(self, source, **kwargs):
return list(self.module.iterparse(source, **kwargs))
@@ -203,6 +207,12 @@ class TestDefusedElementTree(BaseTests):
assert self.module.XMLParser is parser
assert self.module.XMLParse is parser
+ def test_fromstringlist(self):
+ seq = ["<root>", '<tag id="one" />', '<tag id="two" />', "</root>"]
+ tree = self.module.fromstringlist(seq)
+ result = self.module.tostring(tree)
+ self.assertEqual(result, "".join(seq).encode("utf-8"))
+
def test_import_order(self):
from xml.etree import ElementTree as second_elementtree