[pywin32-checkins] pywin32/win32/test test_win32event.py,NONE,1.1
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-01-25 07:53:44
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5461/test Added Files: test_win32event.py Log Message: Add WaitableTimer functions, and a BOOLAPI_NL return type to optimize lock handling. --- NEW FILE: test_win32event.py --- import unittest import win32event import time import os import sys class TestWaitableTimer(unittest.TestCase): def testWaitableFire(self): h = win32event.CreateWaitableTimer(None, 0, None) dt = -160L # 160 ns. win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 1000) self.failUnlessEqual(rc, win32event.WAIT_OBJECT_0) def testWaitableTrigger(self): h = win32event.CreateWaitableTimer(None, 0, None) # for the sake of this, pass a long that doesn't fit in an int. dt = -2000000000L win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 10) # 10 ms. self.failUnlessEqual(rc, win32event.WAIT_TIMEOUT) if __name__=='__main__': unittest.main() |