summaryrefslogtreecommitdiff
path: root/Lib/test/test_sax.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2000-09-24 20:30:24 +0000
committerMartin v. Löwis <martin@v.loewis.de>2000-09-24 20:30:24 +0000
commit33315b180b3cc6981169cf60744445de91a6b8e9 (patch)
treef3d7d3bb33491db3ca2ef6a8f81d8e9856dc029a /Lib/test/test_sax.py
parente292a24589c4eb31c2b0a0cc45f58c3abd0ffc1b (diff)
downloadcpython-git-33315b180b3cc6981169cf60744445de91a6b8e9.tar.gz
Use findfile to locate input and output files.
Diffstat (limited to 'Lib/test/test_sax.py')
-rw-r--r--Lib/test/test_sax.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index 46d0d3e655..5f2c43244d 100644
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -7,7 +7,7 @@ from xml.sax.expatreader import create_parser
from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl
from xml.sax.handler import ContentHandler
from cStringIO import StringIO
-from test_support import verbose, TestFailed
+from test_support import verbose, TestFailed, findfile
# ===== Utilities
@@ -260,7 +260,7 @@ def test_expat_nsattrs_wattr():
# ===== InputSource support
-xml_test_out = open("test.xml.out").read()
+xml_test_out = open(findfile("test.xml.out")).read()
def test_expat_inpsource_filename():
parser = create_parser()
@@ -268,7 +268,7 @@ def test_expat_inpsource_filename():
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse("test.xml")
+ parser.parse(findfile("test.xml"))
return result.getvalue() == xml_test_out
@@ -278,7 +278,7 @@ def test_expat_inpsource_sysid():
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse(InputSource("test.xml"))
+ parser.parse(InputSource(findfile("test.xml")))
return result.getvalue() == xml_test_out
@@ -289,7 +289,7 @@ def test_expat_inpsource_stream():
parser.setContentHandler(xmlgen)
inpsrc = InputSource()
- inpsrc.setByteStream(open("test.xml"))
+ inpsrc.setByteStream(open(findfile("test.xml")))
parser.parse(inpsrc)
return result.getvalue() == xml_test_out
@@ -445,9 +445,9 @@ def make_test_output():
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse("test.xml")
+ parser.parse(findfile("test.xml"))
- outf = open("test.xml.out", "w")
+ outf = open(findfile("test.xml.out"), "w")
outf.write(result.getvalue())
outf.close()