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.

testAXScript.py 1.3KB

1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Test AXScripting the best we can in an automated fashion...
  2. import os
  3. import sys
  4. import win32api
  5. import win32com.axscript
  6. import win32com.axscript.client
  7. import win32com.test.util
  8. verbose = "-v" in sys.argv
  9. class AXScript(win32com.test.util.TestCase):
  10. def setUp(self):
  11. file = win32api.GetFullPathName(
  12. os.path.join(win32com.axscript.client.__path__[0], "pyscript.py")
  13. )
  14. from win32com.test.util import RegisterPythonServer
  15. self.verbose = verbose
  16. RegisterPythonServer(file, "python", verbose=self.verbose)
  17. def testHost(self):
  18. file = win32api.GetFullPathName(
  19. os.path.join(win32com.axscript.__path__[0], "test\\testHost.py")
  20. )
  21. cmd = '%s "%s"' % (win32api.GetModuleFileName(0), file)
  22. if verbose:
  23. print("Testing Python Scripting host")
  24. win32com.test.util.ExecuteShellCommand(cmd, self)
  25. def testCScript(self):
  26. file = win32api.GetFullPathName(
  27. os.path.join(win32com.axscript.__path__[0], "Demos\\Client\\wsh\\test.pys")
  28. )
  29. cmd = 'cscript.exe "%s"' % (file)
  30. if verbose:
  31. print("Testing Windows Scripting host with Python script")
  32. win32com.test.util.ExecuteShellCommand(cmd, self)
  33. if __name__ == "__main__":
  34. win32com.test.util.testmain()