[pywin32-checkins] pywin32/com/win32com/test policySemantics.py,1.2,1.3
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-11-02 10:04:41
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1:/tmp/cvs-serv4853 Modified Files: policySemantics.py Log Message: Convert to unitttest test Index: policySemantics.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/policySemantics.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** policySemantics.py 18 Nov 2002 11:20:06 -0000 1.2 --- policySemantics.py 2 Nov 2003 10:04:39 -0000 1.3 *************** *** 4,7 **** --- 4,9 ---- import winerror + import unittest + class Error(Exception): pass *************** *** 48,52 **** if dispids <> [pythoncom.DISPID_EVALUATE, pythoncom.DISPID_NEWENUM, 10, 11, 1000]: raise Error, "Got back the wrong dispids: %s" % dispids - print "IDispatchEx semantics worked" def SemanticTest(ob): --- 50,53 ---- *************** *** 65,83 **** raise Error, "Evaluate returned", rc - dispexob = dispob.QueryInterface(pythoncom.IID_IDispatchEx) - DispExTest(dispexob) - print "Python policy semantics worked." ! def TestAll(): ! debug=0 ! import win32com.server.dispatcher ! if debug: ! dispatcher=win32com.server.dispatcher.DefaultDebugDispatcher ! else: ! dispatcher=None ! disp = win32com.server.util.wrap(PythonSemanticClass(), useDispatcher=dispatcher) ! ob = win32com.client.Dispatch(disp) ! SemanticTest(ob) if __name__=='__main__': ! TestAll() --- 66,88 ---- raise Error, "Evaluate returned", rc ! class Tester(unittest.TestCase): ! def setUp(self): ! debug=0 ! import win32com.server.dispatcher ! if debug: ! dispatcher=win32com.server.dispatcher.DefaultDebugDispatcher ! else: ! dispatcher=None ! disp = win32com.server.util.wrap(PythonSemanticClass(), useDispatcher=dispatcher) ! self.ob = win32com.client.Dispatch(disp) ! def tearDown(self): ! self.ob = None ! def testSemantics(self): ! SemanticTest(self.ob) ! def testIDispatchEx(self): ! dispexob = self.ob._oleobj_.QueryInterface(pythoncom.IID_IDispatchEx) ! DispExTest(dispexob) if __name__=='__main__': ! unittest.main() |