Update of /cvsroot/pywin32/pywin32/com/win32com/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7696/com/win32com/test
Modified Files:
testPyComTest.py
Log Message:
Much better support for 'named params' in Python gateways. Fixes
[ 1648655 ] Wrong args order with event handler
Index: testPyComTest.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPyComTest.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** testPyComTest.py 11 Feb 2007 12:39:06 -0000 1.27
--- testPyComTest.py 4 Sep 2007 10:53:29 -0000 1.28
***************
*** 67,73 ****
except KeyError:
self.fireds[no] = 0
def _DumpFireds(self):
if not self.fireds:
! print "ERROR: Nothing was recieved!"
for firedId, no in self.fireds.items():
progress("ID %d fired %d times" % (firedId, no))
--- 67,86 ----
except KeyError:
self.fireds[no] = 0
+ def OnFireWithNamedParams(self, no, a_bool, out1, out2):
+ # This test exists mainly to help with an old bug, where named
+ # params would come in reverse.
+ # We know our impl called 'OnFire' with the same ID
+ Missing = pythoncom.Missing
+ if no is not Missing:
+ assert no in self.fireds
+ assert no+1==out1, "expecting 'out1' param to be ID+1"
+ assert no+2==out2, "expecting 'out2' param to be ID+2"
+ # The middle must be a boolean.
+ assert a_bool is Missing or type(a_bool)==bool, "middle param not a bool"
+ return out1+2, out2+2
+
def _DumpFireds(self):
if not self.fireds:
! print "ERROR: Nothing was received!"
for firedId, no in self.fireds.items():
progress("ID %d fired %d times" % (firedId, no))
|