0001 # Test AXScripting the best we can in an automated fashion... 0002 import win32api, os, sys 0003 0004 import win32com.axscript 0005 import win32com.axscript.client 0006 0007 import unittest 0008 import win32com.test.util 0009 0010 verbose = "-v" in sys.argv 0011 0012 class AXScript(win32com.test.util.TestCase): 0013 def setUp(self): 0014 file = win32api.GetFullPathName(os.path.join(win32com.axscript.client.__path__[0], "pyscript.py")) 0015 from util import RegisterPythonServer 0016 self.verbose = verbose 0017 RegisterPythonServer(file, self.verbose) 0018 0019 def testHost(self): 0020 file = win32api.GetFullPathName(os.path.join(win32com.axscript.__path__[0], "test\\testHost.py")) 0021 cmd = '%s "%s"' % (win32api.GetModuleFileName(0), file) 0022 if verbose: 0023 print "Testing Python Scripting host" 0024 win32com.test.util.ExecuteShellCommand(cmd, self) 0025 0026 def testCScript(self): 0027 file = win32api.GetFullPathName(os.path.join(win32com.axscript.__path__[0], "Demos\\Client\\wsh\\test.pys")) 0028 cmd = 'cscript.exe "%s"' % (file) 0029 if verbose: 0030 print "Testing Windows Scripting host with Python script" 0031 win32com.test.util.ExecuteShellCommand(cmd, self) 0032 0033 if __name__=='__main__': 0034 unittest.main() 0035
Generated by PyXR 0.9.4