Update of /cvsroot/pywin32/pywin32/com/win32com/test
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4460/com/win32com/test
Modified Files:
Tag: py3k
testShell.py testall.py util.py
Log Message:
merge lots of changes from the trunk
Index: testall.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testall.py,v
retrieving revision 1.27.2.4
retrieving revision 1.27.2.5
diff -C2 -d -r1.27.2.4 -r1.27.2.5
*** testall.py 27 Nov 2008 11:31:05 -0000 1.27.2.4
--- testall.py 14 Jan 2009 12:42:03 -0000 1.27.2.5
***************
*** 82,85 ****
--- 82,87 ----
ExecuteSilentlyIfOK(cmd, self)
+ # This is a list of "win32com.test.???" module names, optionally with a
+ # function in that module if the module isn't unitest based...
unittest_modules = [
# Level 1 tests.
***************
*** 99,102 ****
--- 101,117 ----
]
+ # A list of other unittest modules we use - these are fully qualified module
+ # names and the module is assumed to be unittest based.
+ unittest_other_modules = [
+ # Level 1 tests.
+ """win32com.directsound.test.ds_test
+ """.split(),
+ # Level 2 tests.
+ [],
+ # Level 3 tests.
+ []
+ ]
+
+
output_checked_programs = [
# Level 1 tests.
***************
*** 171,174 ****
--- 186,206 ----
for test_class in custom_test_cases[i]:
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(test_class))
+ # other "normal" unittest modules.
+ for i in range(testLevel):
+ for mod_name in unittest_other_modules[i]:
+ try:
+ __import__(mod_name)
+ except:
+ import_failures.append((mod_name, sys.exc_info()[:2]))
+ continue
+
+ mod = sys.modules[mod_name]
+ if hasattr(mod, "suite"):
+ test = mod.suite()
+ else:
+ test = loader.loadTestsFromModule(mod)
+ assert test.countTestCases() > 0, "No tests loaded from %r" % mod
+ suite.addTest(test)
+
return suite, import_failures
Index: util.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/util.py,v
retrieving revision 1.9.2.8
retrieving revision 1.9.2.9
diff -C2 -d -r1.9.2.8 -r1.9.2.9
*** util.py 7 Jan 2009 06:25:15 -0000 1.9.2.8
--- util.py 14 Jan 2009 12:42:03 -0000 1.9.2.9
***************
*** 223,226 ****
def testmain(*args, **kw):
! pywin32_testutil.testmain(*args, **new_kw)
CheckClean()
--- 223,226 ----
def testmain(*args, **kw):
! pywin32_testutil.testmain(*args, **kw)
CheckClean()
Index: testShell.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testShell.py,v
retrieving revision 1.10.4.5
retrieving revision 1.10.4.6
diff -C2 -d -r1.10.4.5 -r1.10.4.6
*** testShell.py 7 Jan 2009 06:25:15 -0000 1.10.4.5
--- testShell.py 14 Jan 2009 12:42:02 -0000 1.10.4.6
***************
*** 99,104 ****
class FILEGROUPDESCRIPTORTester(win32com.test.util.TestCase):
def _testRT(self, fd):
! fgd_string = shell.FILEGROUPDESCRIPTORAsString([fd], 1)
! fd2 = shell.StringAsFILEGROUPDESCRIPTOR(fgd_string, 1)[0]
fd = fd.copy()
--- 99,104 ----
class FILEGROUPDESCRIPTORTester(win32com.test.util.TestCase):
def _testRT(self, fd):
! fgd_string = shell.FILEGROUPDESCRIPTORAsString([fd])
! fd2 = shell.StringAsFILEGROUPDESCRIPTOR(fgd_string)[0]
fd = fd.copy()
***************
*** 114,128 ****
self.assertEqual(fd, fd2)
! def testSimple(self):
! fgd = shell.FILEGROUPDESCRIPTORAsString([])
header = struct.pack("i", 0)
self.assertEqual(header, fgd[:len(header)])
self._testRT(dict())
d = dict()
! fgd = shell.FILEGROUPDESCRIPTORAsString([d])
header = struct.pack("i", 1)
self.assertEqual(header, fgd[:len(header)])
self._testRT(d)
!
def testComplex(self):
if sys.hexversion < 0x2030000:
--- 114,134 ----
self.assertEqual(fd, fd2)
! def _testSimple(self, make_unicode):
! fgd = shell.FILEGROUPDESCRIPTORAsString([], make_unicode)
header = struct.pack("i", 0)
self.assertEqual(header, fgd[:len(header)])
self._testRT(dict())
d = dict()
! fgd = shell.FILEGROUPDESCRIPTORAsString([d], make_unicode)
header = struct.pack("i", 1)
self.assertEqual(header, fgd[:len(header)])
self._testRT(d)
!
! def testSimpleBytes(self):
! self._testSimple(False)
!
! def testSimpleUnicode(self):
! self._testSimple(True)
!
def testComplex(self):
if sys.hexversion < 0x2030000:
|