summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_unicode.py2
-rw-r--r--Lib/test/test_xml_etree.py14
2 files changed, 14 insertions, 2 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 00c0fff..9e53213 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1735,8 +1735,6 @@ class UnicodeTest(string_tests.CommonTest,
self.assertRaises(TypeError, "hello".encode, 42, 42, 42)
# Error handling (lone surrogate in PyUnicode_TransformDecimalToASCII())
- self.assertRaises(UnicodeError, int, "\ud800")
- self.assertRaises(UnicodeError, int, "\udf00")
self.assertRaises(UnicodeError, float, "\ud800")
self.assertRaises(UnicodeError, float, "\udf00")
self.assertRaises(UnicodeError, complex, "\ud800")
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index e2ffc19..dec25b5 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1839,6 +1839,20 @@ class ElementFindTest(unittest.TestCase):
summarize_list(e.findall(".//{http://effbot.org/ns}tag")),
['{http://effbot.org/ns}tag'] * 3)
+ def test_findall_different_nsmaps(self):
+ root = ET.XML('''
+ <a xmlns:x="X" xmlns:y="Y">
+ <x:b><c/></x:b>
+ <b/>
+ <c><x:b/><b/></c><y:b/>
+ </a>''')
+ nsmap = {'xx': 'X'}
+ self.assertEqual(len(root.findall(".//xx:b", namespaces=nsmap)), 2)
+ self.assertEqual(len(root.findall(".//b", namespaces=nsmap)), 2)
+ nsmap = {'xx': 'Y'}
+ self.assertEqual(len(root.findall(".//xx:b", namespaces=nsmap)), 1)
+ self.assertEqual(len(root.findall(".//b", namespaces=nsmap)), 2)
+
def test_bad_find(self):
e = ET.XML(SAMPLE_XML)
with self.assertRaisesRegex(SyntaxError, 'cannot use absolute path'):