Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

testxslt.py 921B

1 year ago
12345678910111213141516171819202122232425262728293031323334
  1. import os
  2. import tempfile
  3. import unittest
  4. import win32com.test.util
  5. expected_output = "The jscript test worked.\nThe Python test worked"
  6. class XSLT(win32com.test.util.TestCase):
  7. def testAll(self):
  8. output_name = tempfile.mktemp("-pycom-test")
  9. cmd = (
  10. "cscript //nologo testxslt.js doesnt_matter.xml testxslt.xsl " + output_name
  11. )
  12. win32com.test.util.ExecuteShellCommand(cmd, self)
  13. try:
  14. f = open(output_name)
  15. try:
  16. got = f.read()
  17. if got != expected_output:
  18. print("ERROR: XSLT expected output of %r" % (expected_output,))
  19. print("but got %r" % (got,))
  20. finally:
  21. f.close()
  22. finally:
  23. try:
  24. os.unlink(output_name)
  25. except os.error:
  26. pass
  27. if __name__ == "__main__":
  28. unittest.main()