Update of /cvsroot/pywin32/pywin32/win32/test
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26275/win32/test
Modified Files:
Tag: py3k
handles.py test_pywintypes.py test_security.py
test_win32api.py test_win32wnet.py
Added Files:
Tag: py3k
test_win32gui.py
Log Message:
merge lots of changes from the trunk
Index: test_win32api.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32api.py,v
retrieving revision 1.13.2.2
retrieving revision 1.13.2.3
diff -C2 -d -r1.13.2.2 -r1.13.2.3
*** test_win32api.py 3 Oct 2008 01:09:55 -0000 1.13.2.2
--- test_win32api.py 11 Dec 2008 04:13:36 -0000 1.13.2.3
***************
*** 5,8 ****
--- 5,9 ----
import win32api, win32con, win32event, winerror
import sys, os
+ import tempfile
class CurrentUserTestCase(unittest.TestCase):
***************
*** 138,145 ****
def testLongLongPathNames(self):
# We need filename where the FQN is > 256 - simplest way is to create a
! # 250 character directory in the cwd.
import win32file
basename = "a" * 250
! fname = "\\\\?\\" + os.path.join(os.getcwd(), basename)
try:
win32file.CreateDirectoryW(fname, None)
--- 139,150 ----
def testLongLongPathNames(self):
# We need filename where the FQN is > 256 - simplest way is to create a
! # 250 character directory in the cwd (except - cwd may be on a drive
! # not supporting \\\\?\\ (eg, network share) - so use temp.
import win32file
basename = "a" * 250
! # but we need to ensure we use the 'long' version of the
! # temp dir for later comparison.
! long_temp_dir = win32api.GetLongPathNameW(tempfile.gettempdir())
! fname = "\\\\?\\" + os.path.join(long_temp_dir, basename)
try:
win32file.CreateDirectoryW(fname, None)
Index: test_security.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_security.py,v
retrieving revision 1.4.4.1
retrieving revision 1.4.4.2
diff -C2 -d -r1.4.4.1 -r1.4.4.2
*** test_security.py 27 Nov 2008 11:31:11 -0000 1.4.4.1
--- test_security.py 11 Dec 2008 04:13:36 -0000 1.4.4.2
***************
*** 13,16 ****
--- 13,26 ----
pass
+ def testEqual(self):
+ self.failUnlessEqual(win32security.LookupAccountName('','Administrator')[0],
+ win32security.LookupAccountName('','Administrator')[0])
+
+ def testBuffer(self):
+ # hrm - what about py3k - intent is to check the buffer slots return
+ # something sane.
+ self.failUnlessEqual(buffer(win32security.LookupAccountName('','Administrator')[0]),
+ buffer(win32security.LookupAccountName('','Administrator')[0]))
+
def testMemory(self):
pwr_sid = self.pwr_sid
Index: test_pywintypes.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_pywintypes.py,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -C2 -d -r1.3.4.1 -r1.3.4.2
*** test_pywintypes.py 13 Sep 2008 20:34:03 -0000 1.3.4.1
--- test_pywintypes.py 11 Dec 2008 04:13:36 -0000 1.3.4.2
***************
*** 22,25 ****
--- 22,38 ----
return
+ def testPyTimeCompare(self):
+ t1 = pywintypes.Time(100)
+ t1_2 = pywintypes.Time(100)
+ t2 = pywintypes.Time(101)
+
+ self.failUnlessEqual(t1, t1_2)
+ self.failUnless(t1 <= t1_2)
+ self.failUnless(t1_2 >= t1)
+
+ self.failIfEqual(t1, t2)
+ self.failUnless(t1 < t2)
+ self.failUnless(t2 > t1 )
+
def testGUID(self):
s = "{00020400-0000-0000-C000-000000000046}"
Index: test_win32wnet.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32wnet.py,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -C2 -d -r1.1.4.1 -r1.1.4.2
*** test_win32wnet.py 10 Dec 2008 11:01:22 -0000 1.1.4.1
--- test_win32wnet.py 11 Dec 2008 04:13:36 -0000 1.1.4.2
***************
*** 57,61 ****
val = getattr(item, attr)
if typ is int:
! self.failUnless(type(val) in (int, int),
"Attr %r has value %r" % (attr, val))
new_val = val + 1
--- 57,61 ----
val = getattr(item, attr)
if typ is int:
! self.failUnless(type(val) in (int,),
"Attr %r has value %r" % (attr, val))
new_val = val + 1
Index: handles.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.py,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -C2 -d -r1.4.2.2 -r1.4.2.3
*** handles.py 27 Nov 2008 11:31:10 -0000 1.4.2.2
--- handles.py 11 Dec 2008 04:13:36 -0000 1.4.2.3
***************
*** 88,92 ****
# >>> struct.unpack("P", struct.pack("P", -1))
# (4294967295L,)
! pywintypes.HANDLE(sys.maxint+1)
def testGC(self):
--- 88,96 ----
# >>> struct.unpack("P", struct.pack("P", -1))
# (4294967295L,)
! try:
! big = sys.maxsize
! except AttributeError:
! big = sys.maxint
! pywintypes.HANDLE(big+1)
def testGC(self):
--- NEW FILE: test_win32gui.py ---
# tests for win32gui
import unittest
import win32gui
class TestMisc(unittest.TestCase):
def test_get_string(self):
# test invalid addresses cause a ValueError rather than crash!
self.assertRaises(ValueError, win32gui.PyGetString, 0)
self.assertRaises(ValueError, win32gui.PyGetString, 1)
self.assertRaises(ValueError, win32gui.PyGetString, 1,1)
if __name__=='__main__':
unittest.main()
|