0001 import os 0002 import tempfile 0003 import unittest 0004 import win32com.test.util 0005 0006 expected_output = "The jscript test worked.\nThe Python test worked" 0007 0008 class XSLT(win32com.test.util.TestCase): 0009 def testAll(self): 0010 output_name = tempfile.mktemp("-pycom-test") 0011 cmd = "cscript //nologo testxslt.js doesnt_matter.xml testxslt.xsl " + output_name 0012 win32com.test.util.ExecuteShellCommand(cmd, self) 0013 try: 0014 f=open(output_name) 0015 try: 0016 got = f.read() 0017 if got != expected_output: 0018 print "ERROR: XSLT expected output of %r" % (expected_output,) 0019 print "but got %r" % (got,) 0020 finally: 0021 f.close() 0022 finally: 0023 try: 0024 os.unlink(output_name) 0025 except os.error: 0026 pass 0027 0028 if __name__=='__main__': 0029 unittest.main() 0030
Generated by PyXR 0.9.4