summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_minidom.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-02 17:55:59 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-02 17:55:59 (GMT)
commitaa9563c1b8b8187282c0cad2b0e3c0ed7f6a8dc9 (patch)
tree7582c9bfdb3b1931d249d8eccd35a852b14ff341 /Lib/test/test_minidom.py
parent2379d541dd2a4944713999f0071d53fdddee3d47 (diff)
downloadcpython-aa9563c1b8b8187282c0cad2b0e3c0ed7f6a8dc9.zip
cpython-aa9563c1b8b8187282c0cad2b0e3c0ed7f6a8dc9.tar.gz
cpython-aa9563c1b8b8187282c0cad2b0e3c0ed7f6a8dc9.tar.bz2
Issue #2175: Added tests for xml.sax.saxutils.prepare_input_source().
Made test XML files non-ASCII.
Diffstat (limited to 'Lib/test/test_minidom.py')
-rw-r--r--Lib/test/test_minidom.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index d06a83d..05df6e9 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -49,8 +49,14 @@ class MinidomTest(unittest.TestCase):
t = node.wholeText
self.confirm(t == s, "looking for %r, found %r" % (s, t))
- def testParseFromFile(self):
- with open(tstfile) as file:
+ def testParseFromBinaryFile(self):
+ with open(tstfile, 'rb') as file:
+ dom = parse(file)
+ dom.unlink()
+ self.confirm(isinstance(dom, Document))
+
+ def testParseFromTextFile(self):
+ with open(tstfile, 'r', encoding='iso-8859-1') as file:
dom = parse(file)
dom.unlink()
self.confirm(isinstance(dom, Document))