home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_2910 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  1.2 KB  |  41 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import os
  5. import tempfile
  6. import unittest
  7. import win32com.test.util as win32com
  8. expected_output = 'The jscript test worked.\nThe Python test worked'
  9.  
  10. class XSLT(win32com.test.util.TestCase):
  11.     
  12.     def testAll(self):
  13.         output_name = tempfile.mktemp('-pycom-test')
  14.         cmd = 'cscript //nologo testxslt.js doesnt_matter.xml testxslt.xsl ' + output_name
  15.         win32com.test.util.ExecuteShellCommand(cmd, self)
  16.         
  17.         try:
  18.             f = open(output_name)
  19.             
  20.             try:
  21.                 got = f.read()
  22.                 if got != expected_output:
  23.                     print 'ERROR: XSLT expected output of %r' % (expected_output,)
  24.                     print 'but got %r' % (got,)
  25.             finally:
  26.                 f.close()
  27.  
  28.         finally:
  29.             
  30.             try:
  31.                 os.unlink(output_name)
  32.             except os.error:
  33.                 pass
  34.  
  35.  
  36.  
  37.  
  38. if __name__ == '__main__':
  39.     unittest.main()
  40.  
  41.