Update of /cvsroot/pywin32/pywin32/win32/test
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24579/win32/test
Modified Files:
Tag: py3k
handles.py test_odbc.py test_pywintypes.py test_win32event.py
test_win32trace.py
Log Message:
merge recent changes from the trunk
Index: test_pywintypes.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_pywintypes.py,v
retrieving revision 1.3.4.4
retrieving revision 1.3.4.5
diff -C2 -d -r1.3.4.4 -r1.3.4.5
*** test_pywintypes.py 8 Jan 2009 03:45:50 -0000 1.3.4.4
--- test_pywintypes.py 25 Jan 2009 04:52:20 -0000 1.3.4.5
***************
*** 10,14 ****
pytime_current = pywintypes.Time(struct_current)
# try and test all the standard parts of the format
! format_strings = "%a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y %Z"
for fmt in format_strings.split():
v1 = pytime_current.Format(fmt)
--- 10,16 ----
pytime_current = pywintypes.Time(struct_current)
# try and test all the standard parts of the format
! # Note we used to include '%Z' testing, but that was pretty useless as
! # it always returned the local timezone.
! format_strings = "%a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y"
for fmt in format_strings.split():
v1 = pytime_current.Format(fmt)
Index: test_odbc.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_odbc.py,v
retrieving revision 1.7.2.4
retrieving revision 1.7.2.5
diff -C2 -d -r1.7.2.4 -r1.7.2.5
*** test_odbc.py 7 Jan 2009 06:25:16 -0000 1.7.2.4
--- test_odbc.py 25 Jan 2009 04:52:20 -0000 1.7.2.5
***************
*** 130,134 ****
self._test_val('intfield', 1)
self._test_val('intfield', 0)
! self._test_val('intfield', sys.maxsize)
def testFloat(self):
--- 130,138 ----
self._test_val('intfield', 1)
self._test_val('intfield', 0)
! try:
! big = sys.maxsize
! except AttributeError:
! big = sys.maxint
! self._test_val('intfield', big)
def testFloat(self):
Index: test_win32trace.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32trace.py,v
retrieving revision 1.5.4.2
retrieving revision 1.5.4.3
diff -C2 -d -r1.5.4.2 -r1.5.4.3
*** test_win32trace.py 4 Dec 2008 07:28:46 -0000 1.5.4.2
--- test_win32trace.py 25 Jan 2009 04:52:20 -0000 1.5.4.3
***************
*** 15,19 ****
time.sleep(0.05)
if win32trace.read() != "Hi":
! # Reset everything so following tests still fail with this error!S
win32trace.TermRead()
win32trace.TermWrite()
--- 15,19 ----
time.sleep(0.05)
if win32trace.read() != "Hi":
! # Reset everything so following tests still fail with this error!
win32trace.TermRead()
win32trace.TermWrite()
***************
*** 102,109 ****
--- 102,122 ----
self.assertEquals('Syver Enstad', syverEnstad)
+ def testRoundTripUnicode(self):
+ win32trace.write('\xa9opyright Syver Enstad')
+ syverEnstad = win32trace.read()
+ # str objects are always returned in py2k (latin-1 encoding was used
+ # on unicode objects)
+ self.assertEquals('\xa9opyright Syver Enstad', syverEnstad)
+
def testBlockingRead(self):
win32trace.write('Syver Enstad')
self.assertEquals('Syver Enstad', win32trace.blockingread())
+ def testBlockingReadUnicode(self):
+ win32trace.write('\xa9opyright Syver Enstad')
+ # str objects are always returned in py2k (latin-1 encoding was used
+ # on unicode objects)
+ self.assertEquals('\xa9opyright Syver Enstad', win32trace.blockingread())
+
def testFlush(self):
win32trace.flush()
Index: test_win32event.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32event.py,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -C2 -d -r1.1.4.2 -r1.1.4.3
*** test_win32event.py 27 Nov 2008 11:31:11 -0000 1.1.4.2
--- test_win32event.py 25 Jan 2009 04:52:20 -0000 1.1.4.3
***************
*** 4,9 ****
--- 4,17 ----
import os
import sys
+ from pywin32_testutil import int2long
class TestWaitableTimer(unittest.TestCase):
+ def testWaitableFireLong(self):
+ h = win32event.CreateWaitableTimer(None, 0, None)
+ dt = int2long(-160) # 160 ns.
+ win32event.SetWaitableTimer(h, dt, 0, None, None, 0)
+ rc = win32event.WaitForSingleObject(h, 1000)
+ self.failUnlessEqual(rc, win32event.WAIT_OBJECT_0)
+
def testWaitableFire(self):
h = win32event.CreateWaitableTimer(None, 0, None)
Index: handles.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.py,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -C2 -d -r1.4.2.3 -r1.4.2.4
*** handles.py 11 Dec 2008 04:13:36 -0000 1.4.2.3
--- handles.py 25 Jan 2009 04:52:20 -0000 1.4.2.4
***************
*** 3,6 ****
--- 3,7 ----
import pywintypes
import win32api
+ from pywin32_testutil import int2long
# A class that will never die vie refcounting, but will die via GC.
***************
*** 108,112 ****
self.assertRaises(TypeError, pywintypes.HANDLE, ())
# should be able to get a long!
! pywintypes.HANDLE(0)
if __name__ == '__main__':
--- 109,113 ----
self.assertRaises(TypeError, pywintypes.HANDLE, ())
# should be able to get a long!
! pywintypes.HANDLE(int2long(0))
if __name__ == '__main__':
|