Update of /cvsroot/pywin32/pywin32/com/win32com/test
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1302/com/win32com/test
Modified Files:
Tag: py3k
GenTestScripts.py policySemantics.py testClipboard.py
testCollections.py testDictionary.py testDynamic.py testGIT.py
testGatewayAddresses.py testMSOffice.py testPyComTest.py
testShell.py util.py
Log Message:
Almost all files in py3k branch are now in py3k syntax - but work remains
Index: GenTestScripts.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/GenTestScripts.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
*** GenTestScripts.py 26 Nov 2008 09:03:29 -0000 1.3.4.1
--- GenTestScripts.py 27 Nov 2008 04:58:41 -0000 1.3.4.2
***************
*** 31,35 ****
print("compiling -", end=' ')
fullModName = "win32com.test.%s.%s" % (genDir, fname)
! exec "import " + fullModName
# Inject the generated module as a top level module.
sys.modules[fname] = sys.modules[fullModName]
--- 31,35 ----
print("compiling -", end=' ')
fullModName = "win32com.test.%s.%s" % (genDir, fname)
! exec("import " + fullModName)
# Inject the generated module as a top level module.
sys.modules[fname] = sys.modules[fullModName]
Index: testGatewayAddresses.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testGatewayAddresses.py,v
retrieving revision 1.2.4.2
retrieving revision 1.2.4.3
diff -C2 -d -r1.2.4.2 -r1.2.4.3
*** testGatewayAddresses.py 26 Nov 2008 09:03:29 -0000 1.2.4.2
--- testGatewayAddresses.py 27 Nov 2008 04:58:41 -0000 1.2.4.3
***************
*** 58,62 ****
global numErrors
numErrors = numErrors + 1
! print(when, "are not identical (%s, %s)" % (`ob1`, `ob2`))
--- 58,62 ----
global numErrors
numErrors = numErrors + 1
! print(when, "are not identical (%s, %s)" % (repr(ob1), repr(ob2)))
Index: policySemantics.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/policySemantics.py,v
retrieving revision 1.4.4.2
retrieving revision 1.4.4.3
diff -C2 -d -r1.4.4.2 -r1.4.4.3
*** policySemantics.py 26 Nov 2008 09:03:29 -0000 1.4.4.2
--- policySemantics.py 27 Nov 2008 04:58:41 -0000 1.4.4.3
***************
*** 50,54 ****
break
dispids.sort()
! if dispids <> [pythoncom.DISPID_EVALUATE, pythoncom.DISPID_NEWENUM, 10, 11, 1000]:
raise Error("Got back the wrong dispids: %s" % dispids)
--- 50,54 ----
break
dispids.sort()
! if dispids != [pythoncom.DISPID_EVALUATE, pythoncom.DISPID_NEWENUM, 10, 11, 1000]:
raise Error("Got back the wrong dispids: %s" % dispids)
***************
*** 60,64 ****
# invoke _value_
if ob() != (1,2,3):
! raise Error("Bad result - got %s" % (`ob()`))
dispob = ob._oleobj_
--- 60,64 ----
# invoke _value_
if ob() != (1,2,3):
! raise Error("Bad result - got %s" % (repr(ob())))
dispob = ob._oleobj_
***************
*** 66,70 ****
rc = dispob.Invoke(pythoncom.DISPID_EVALUATE, 0, pythoncom.DISPATCH_METHOD|pythoncom.DISPATCH_PROPERTYGET, 1)
if rc != 6:
! raise Error("Evaluate returned").with_traceback(rc)
--- 66,70 ----
rc = dispob.Invoke(pythoncom.DISPID_EVALUATE, 0, pythoncom.DISPATCH_METHOD|pythoncom.DISPATCH_PROPERTYGET, 1)
if rc != 6:
! raise Error("Evaluate returned %d" % rc)
Index: testPyComTest.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPyComTest.py,v
retrieving revision 1.32.2.2
retrieving revision 1.32.2.3
diff -C2 -d -r1.32.2.2 -r1.32.2.3
*** testPyComTest.py 26 Nov 2008 09:03:29 -0000 1.32.2.2
--- testPyComTest.py 27 Nov 2008 04:58:41 -0000 1.32.2.3
***************
*** 24,28 ****
print("The PyCOMTest module can not be located or generated.")
print(importMsg)
! raise RuntimeError, importMsg
# We had a bg where RegisterInterfaces would fail if gencache had
--- 24,28 ----
print("The PyCOMTest module can not be located or generated.")
print(importMsg)
! raise RuntimeError(importMsg)
# We had a bg where RegisterInterfaces would fail if gencache had
***************
*** 49,53 ****
rc = apply(fn, args)
if rc != result:
! raise error, "%s failed - result not %r but %r" % (pref, result, rc)
def TestConstant(constName, pyConst):
--- 49,53 ----
rc = apply(fn, args)
if rc != result:
! raise error("%s failed - result not %r but %r" % (pref, result, rc))
def TestConstant(constName, pyConst):
***************
*** 55,61 ****
comConst = getattr(constants, constName)
except:
! raise error, "Constant %s missing" % (constName,)
if comConst != pyConst:
! raise error, "Constant value wrong for %s - got %s, wanted %s" % (constName, comConst, pyConst)
# Simple handler class. This demo only fires one event.
--- 55,61 ----
comConst = getattr(constants, constName)
except:
! raise error("Constant %s missing" % (constName,))
if comConst != pyConst:
! raise error("Constant value wrong for %s - got %s, wanted %s" % (constName, comConst, pyConst))
# Simple handler class. This demo only fires one event.
***************
*** 100,116 ****
if rc[:-1] != ("def", 0, 1) or abs(rc[-1]-3.14)>.01:
print(rc)
! raise error, "Did not get the optional values correctly"
rc = o.TestOptionals("Hi", 2, 3, 1.1)
if rc[:-1] != ("Hi", 2, 3) or abs(rc[-1]-1.1)>.01:
print(rc)
! raise error, "Did not get the specified optional values correctly"
rc = o.TestOptionals2(0)
if rc != (0, "", 1):
print(rc)
! raise error, "Did not get the optional2 values correctly"
rc = o.TestOptionals2(1.1, "Hi", 2)
if rc[1:] != ("Hi", 2) or abs(rc[0]-1.1)>.01:
print(rc)
! raise error, "Did not get the specified optional2 values correctly"
# if verbose: print "Testing structs"
--- 100,116 ----
if rc[:-1] != ("def", 0, 1) or abs(rc[-1]-3.14)>.01:
print(rc)
! raise error("Did not get the optional values correctly")
rc = o.TestOptionals("Hi", 2, 3, 1.1)
if rc[:-1] != ("Hi", 2, 3) or abs(rc[-1]-1.1)>.01:
print(rc)
! raise error("Did not get the specified optional values correctly")
rc = o.TestOptionals2(0)
if rc != (0, "", 1):
print(rc)
! raise error("Did not get the optional2 values correctly")
rc = o.TestOptionals2(1.1, "Hi", 2)
if rc[1:] != ("Hi", 2) or abs(rc[0]-1.1)>.01:
print(rc)
! raise error("Did not get the specified optional2 values correctly")
# if verbose: print "Testing structs"
***************
*** 129,136 ****
o.LongProp = 3
if o.LongProp != 3 or o.IntProp != 3:
! raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp)
o.LongProp = o.IntProp = -3
if o.LongProp != -3 or o.IntProp != -3:
! raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp)
# This number fits in an unsigned long. Attempting to set it to a normal
# long will involve overflow, which is to be expected. But we do
--- 129,136 ----
o.LongProp = 3
if o.LongProp != 3 or o.IntProp != 3:
! raise error("Property value wrong - got %d/%d" % (o.LongProp,o.IntProp))
o.LongProp = o.IntProp = -3
if o.LongProp != -3 or o.IntProp != -3:
! raise error("Property value wrong - got %d/%d" % (o.LongProp,o.IntProp))
# This number fits in an unsigned long. Attempting to set it to a normal
# long will involve overflow, which is to be expected. But we do
***************
*** 139,147 ****
o.ULongProp = check
if o.ULongProp != check:
! raise error, "Property value wrong - got %d (expected %d)" % (o.ULongProp, check)
# currency.
pythoncom.__future_currency__ = 1
if o.CurrencyProp != 0:
! raise error, "Expecting 0, got %r" % (o.CurrencyProp,)
try:
import decimal
--- 139,147 ----
o.ULongProp = check
if o.ULongProp != check:
! raise error("Property value wrong - got %d (expected %d)" % (o.ULongProp, check))
# currency.
pythoncom.__future_currency__ = 1
if o.CurrencyProp != 0:
! raise error("Expecting 0, got %r" % (o.CurrencyProp,))
try:
import decimal
***************
*** 150,154 ****
o.CurrencyProp = decimal.Decimal("1234.5678")
if o.CurrencyProp != decimal.Decimal("1234.5678"):
! raise error, "got %r" % (o.CurrencyProp,)
v1 = decimal.Decimal("1234.5678")
# can't do "DoubleCurrencyByVal" in dynamic files.
--- 150,154 ----
o.CurrencyProp = decimal.Decimal("1234.5678")
if o.CurrencyProp != decimal.Decimal("1234.5678"):
! raise error("got %r" % (o.CurrencyProp,))
v1 = decimal.Decimal("1234.5678")
# can't do "DoubleCurrencyByVal" in dynamic files.
***************
*** 183,187 ****
if type(i1) != types.InstanceType or type(i2) != types.InstanceType:
# Yay - is now an instance returned!
! raise error, "GetMultipleInterfaces did not return instances - got '%s', '%s'" % (i1, i2)
del i1
del i2
--- 183,187 ----
if type(i1) != types.InstanceType or type(i2) != types.InstanceType:
# Yay - is now an instance returned!
! raise error("GetMultipleInterfaces did not return instances - got '%s', '%s'" % (i1, i2))
del i1
del i2
***************
*** 191,244 ****
if rc[:-1] != ("def", 0, 1) or abs(rc[-1]-3.14)>.01:
print(rc)
! raise error, "Did not get the optional values correctly"
rc = o.TestOptionals("Hi", 2, 3, 1.1)
if rc[:-1] != ("Hi", 2, 3) or abs(rc[-1]-1.1)>.01:
print(rc)
! raise error, "Did not get the specified optional values correctly"
rc = o.TestOptionals2(0)
if rc != (0, "", 1):
print(rc)
! raise error, "Did not get the optional2 values correctly"
rc = o.TestOptionals2(1.1, "Hi", 2)
if rc[1:] != ("Hi", 2) or abs(rc[0]-1.1)>.01:
print(rc)
! raise error, "Did not get the specified optional2 values correctly"
progress("Checking var args")
o.SetVarArgs("Hi", "There", "From", "Python", 1)
if o.GetLastVarArgs() != ("Hi", "There", "From", "Python", 1):
! raise error, "VarArgs failed -" + str(o.GetLastVarArgs())
progress("Checking getting/passing IUnknown")
if o.GetSetUnknown(o) != o:
! raise error, "GetSetUnknown failed"
progress("Checking getting/passing IDispatch")
if type(o.GetSetDispatch(o)) !=types.InstanceType:
! raise error, "GetSetDispatch failed"
progress("Checking getting/passing IDispatch of known type")
if o.GetSetInterface(o).__class__ != o.__class__:
! raise error, "GetSetDispatch failed"
if o.GetSetVariant(4) != 4:
! raise error, "GetSetVariant (int) failed"
if o.GetSetVariant("foo") != "foo":
! raise error, "GetSetVariant (str) failed"
if o.GetSetVariant(o) != o:
! raise error, "GetSetVariant (dispatch) failed"
! for l in sys.maxint, sys.maxint+1, 1 << 65L:
if o.GetSetVariant(l) != l:
! raise error, "GetSetVariant (long) failed"
if o.TestByRefVariant(2) != 4:
! raise error, "TestByRefVariant failed"
if o.TestByRefString("Foo") != "FooFoo":
! raise error, "TestByRefString failed"
# Pass some non-sequence objects to our array decoder, and watch it fail.
try:
o.SetVariantSafeArray("foo")
! raise error, "Expected a type error"
except TypeError:
pass
try:
o.SetVariantSafeArray(666)
! raise error, "Expected a type error"
except TypeError:
pass
--- 191,244 ----
if rc[:-1] != ("def", 0, 1) or abs(rc[-1]-3.14)>.01:
print(rc)
! raise error("Did not get the optional values correctly")
rc = o.TestOptionals("Hi", 2, 3, 1.1)
if rc[:-1] != ("Hi", 2, 3) or abs(rc[-1]-1.1)>.01:
print(rc)
! raise error("Did not get the specified optional values correctly")
rc = o.TestOptionals2(0)
if rc != (0, "", 1):
print(rc)
! raise error("Did not get the optional2 values correctly")
rc = o.TestOptionals2(1.1, "Hi", 2)
if rc[1:] != ("Hi", 2) or abs(rc[0]-1.1)>.01:
print(rc)
! raise error("Did not get the specified optional2 values correctly")
progress("Checking var args")
o.SetVarArgs("Hi", "There", "From", "Python", 1)
if o.GetLastVarArgs() != ("Hi", "There", "From", "Python", 1):
! raise error("VarArgs failed -" + str(o.GetLastVarArgs()))
progress("Checking getting/passing IUnknown")
if o.GetSetUnknown(o) != o:
! raise error("GetSetUnknown failed")
progress("Checking getting/passing IDispatch")
if type(o.GetSetDispatch(o)) !=types.InstanceType:
! raise error("GetSetDispatch failed")
progress("Checking getting/passing IDispatch of known type")
if o.GetSetInterface(o).__class__ != o.__class__:
! raise error("GetSetDispatch failed")
if o.GetSetVariant(4) != 4:
! raise error("GetSetVariant (int) failed")
if o.GetSetVariant("foo") != "foo":
! raise error("GetSetVariant (str) failed")
if o.GetSetVariant(o) != o:
! raise error("GetSetVariant (dispatch) failed")
! for l in sys.maxint, sys.maxint+1, 1 << 65:
if o.GetSetVariant(l) != l:
! raise error("GetSetVariant (long) failed")
if o.TestByRefVariant(2) != 4:
! raise error("TestByRefVariant failed")
if o.TestByRefString("Foo") != "FooFoo":
! raise error("TestByRefString failed")
# Pass some non-sequence objects to our array decoder, and watch it fail.
try:
o.SetVariantSafeArray("foo")
! raise error("Expected a type error")
except TypeError:
pass
try:
o.SetVariantSafeArray(666)
! raise error("Expected a type error")
except TypeError:
pass
***************
*** 272,283 ****
TestApplyResult(o.Test6, (constants.WideAttr5,), constants.WideAttr5)
! TestConstant("ULongTest1", 0xFFFFFFFFL)
! TestConstant("ULongTest2", 0x7FFFFFFFL)
! TestConstant("LongTest1", -0x7FFFFFFFL)
! TestConstant("LongTest2", 0x7FFFFFFFL)
TestConstant("UCharTest", 255)
TestConstant("CharTest", -1)
# 'Hello Loraine', but the 'r' is the "Registered" sign (\xae)
! TestConstant("StringTest", u"Hello Lo\xaeaine")
now = pythoncom.MakeTime(time.gmtime(time.time()))
--- 272,283 ----
TestApplyResult(o.Test6, (constants.WideAttr5,), constants.WideAttr5)
! TestConstant("ULongTest1", 0xFFFFFFFF)
! TestConstant("ULongTest2", 0x7FFFFFFF)
! TestConstant("LongTest1", -0x7FFFFFFF)
! TestConstant("LongTest2", 0x7FFFFFFF)
TestConstant("UCharTest", 255)
TestConstant("CharTest", -1)
# 'Hello Loraine', but the 'r' is the "Registered" sign (\xae)
! TestConstant("StringTest", "Hello Lo\xaeaine")
now = pythoncom.MakeTime(time.gmtime(time.time()))
***************
*** 297,315 ****
o.LongProp = 3
if o.LongProp != 3 or o.IntProp != 3:
! raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp)
o.LongProp = o.IntProp = -3
if o.LongProp != -3 or o.IntProp != -3:
! raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp)
check = 3 *10 **9
o.ULongProp = check
if o.ULongProp != check:
! raise error, "Property value wrong - got %d (expected %d)" % (o.ULongProp, check)
# currency.
pythoncom.__future_currency__ = 1
if o.CurrencyProp != 0:
! raise error, "Expecting 0, got %r" % (o.CurrencyProp,)
try:
import decimal
--- 297,315 ----
o.LongProp = 3
if o.LongProp != 3 or o.IntProp != 3:
! raise error("Property value wrong - got %d/%d" % (o.LongProp,o.IntProp))
o.LongProp = o.IntProp = -3
if o.LongProp != -3 or o.IntProp != -3:
! raise error("Property value wrong - got %d/%d" % (o.LongProp,o.IntProp))
check = 3 *10 **9
o.ULongProp = check
if o.ULongProp != check:
! raise error("Property value wrong - got %d (expected %d)" % (o.ULongProp, check))
# currency.
pythoncom.__future_currency__ = 1
if o.CurrencyProp != 0:
! raise error("Expecting 0, got %r" % (o.CurrencyProp,))
try:
import decimal
***************
*** 319,323 ****
o.CurrencyProp = decimal.Decimal(val)
if o.CurrencyProp != decimal.Decimal(val):
! raise error, "%s got %r" % (val, o.CurrencyProp)
v1 = decimal.Decimal("1234.5678")
TestApplyResult(o.DoubleCurrency, (v1,), v1*2)
--- 319,323 ----
o.CurrencyProp = decimal.Decimal(val)
if o.CurrencyProp != decimal.Decimal(val):
! raise error("%s got %r" % (val, o.CurrencyProp))
v1 = decimal.Decimal("1234.5678")
TestApplyResult(o.DoubleCurrency, (v1,), v1*2)
***************
*** 328,332 ****
o.SetParamProp(0, 1)
if o.ParamProp(0) != 1:
! raise RuntimeError, o.paramProp(0)
# Do the connection point thing...
--- 328,332 ----
o.SetParamProp(0, 1)
if o.ParamProp(0) != 1:
! raise RuntimeError(o.paramProp(0))
# Do the connection point thing...
***************
*** 351,355 ****
def TestCounter(counter, bIsGenerated):
# Test random access into container
! progress("Testing counter", `counter`)
import random
for i in xrange(50):
--- 351,355 ----
def TestCounter(counter, bIsGenerated):
# Test random access into container
! progress("Testing counter", repr(counter))
import random
for i in xrange(50):
***************
*** 358,364 ****
ret = counter[num]
if ret != num+1:
! raise error, "Random access into element %d failed - return was %s" % (num,`ret`)
except IndexError:
! raise error, "** IndexError accessing collection element %d" % num
num = 0
--- 358,364 ----
ret = counter[num]
if ret != num+1:
! raise error("Random access into element %d failed - return was %s" % (num,repr(ret)))
except IndexError:
! raise error("** IndexError accessing collection element %d" % num)
num = 0
***************
*** 368,374 ****
counter.SetTestProperty(1,2)
if counter.TestPropertyWithDef != 0:
! raise error, "Unexpected property set value!"
if counter.TestPropertyNoDef(1) != 1:
! raise error, "Unexpected property set value!"
else:
pass
--- 368,374 ----
counter.SetTestProperty(1,2)
if counter.TestPropertyWithDef != 0:
! raise error("Unexpected property set value!")
if counter.TestPropertyNoDef(1) != 1:
! raise error("Unexpected property set value!")
else:
pass
***************
*** 377,395 ****
counter.LBound=1
counter.UBound=10
! if counter.LBound <> 1 or counter.UBound<>10:
print("** Error - counter did not keep its properties")
if bIsGenerated:
bounds = counter.GetBounds()
! if bounds[0]<>1 or bounds[1]<>10:
! raise error, "** Error - counter did not give the same properties back"
counter.SetBounds(bounds[0], bounds[1])
for item in counter:
num = num + 1
! if num <> len(counter):
! raise error, "*** Length of counter and loop iterations dont match ***"
! if num <> 10:
! raise error, "*** Unexpected number of loop iterations ***"
counter = counter._enum_.Clone() # Test Clone() and enum directly
--- 377,395 ----
counter.LBound=1
counter.UBound=10
! if counter.LBound != 1 or counter.UBound!=10:
print("** Error - counter did not keep its properties")
if bIsGenerated:
bounds = counter.GetBounds()
! if bounds[0]!=1 or bounds[1]!=10:
! raise error("** Error - counter did not give the same properties back")
counter.SetBounds(bounds[0], bounds[1])
for item in counter:
num = num + 1
! if num != len(counter):
! raise error("*** Length of counter and loop iterations dont match ***")
! if num != 10:
! raise error("*** Unexpected number of loop iterations ***")
counter = counter._enum_.Clone() # Test Clone() and enum directly
***************
*** 398,403 ****
for item in counter:
num = num + 1
! if num <> 10:
! raise error, "*** Unexpected number of loop iterations - got %d ***" % num
progress("Finished testing counter")
--- 398,403 ----
for item in counter:
num = num + 1
! if num != 10:
! raise error("*** Unexpected number of loop iterations - got %d ***" % num)
progress("Finished testing counter")
Index: testCollections.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testCollections.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
*** testCollections.py 26 Nov 2008 09:03:29 -0000 1.4.4.1
--- testCollections.py 27 Nov 2008 04:58:41 -0000 1.4.4.2
***************
*** 34,42 ****
for i in range(len(check)):
if o(i) != check[i]:
! raise error("Using default method gave the incorrect value - %s/%s" % (`o(i)`, `check[i]`))
for i in range(len(check)):
if o.Item(i) != check[i]:
! raise error("Using Item method gave the incorrect value - %s/%s" % (`o(i)`, `check[i]`))
# First try looping.
--- 34,42 ----
for i in range(len(check)):
if o(i) != check[i]:
! raise error("Using default method gave the incorrect value - %s/%s" % (repr(o(i)), repr(check[i])))
for i in range(len(check)):
if o.Item(i) != check[i]:
! raise error("Using Item method gave the incorrect value - %s/%s" % (repr(o(i)), repr(check[i])))
# First try looping.
***************
*** 46,50 ****
if cmp[:len(check)] != check:
! raise error("Result after looping isnt correct - %s/%s" % (`cmp[:len(check)]`, `check`))
for i in range(len(check)):
--- 46,50 ----
if cmp[:len(check)] != check:
! raise error("Result after looping isnt correct - %s/%s" % (repr(cmp[:len(check)]), repr(check)))
for i in range(len(check)):
Index: util.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/util.py,v
retrieving revision 1.9.2.3
retrieving revision 1.9.2.4
diff -C2 -d -r1.9.2.3 -r1.9.2.4
*** util.py 26 Nov 2008 09:03:29 -0000 1.9.2.3
--- util.py 27 Nov 2008 04:58:41 -0000 1.9.2.4
***************
*** 7,11 ****
import pythoncom
import winerror
! import cStringIO as StringIO
from pythoncom import _GetInterfaceCount, _GetGatewayCount
import win32com
--- 7,16 ----
import pythoncom
import winerror
!
! try:
! import cStringIO as StringIO
! except:
! import io as StringIO
!
from pythoncom import _GetInterfaceCount, _GetGatewayCount
import win32com
Index: testShell.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testShell.py,v
retrieving revision 1.10.4.2
retrieving revision 1.10.4.3
diff -C2 -d -r1.10.4.2 -r1.10.4.3
*** testShell.py 26 Nov 2008 07:17:39 -0000 1.10.4.2
--- testShell.py 27 Nov 2008 04:58:41 -0000 1.10.4.3
***************
*** 161,165 ****
ftLastWriteTime=pythoncom.MakeTime(12),
nFileSize=sys_maxsize + 1),
! dict(cFileName=u"foo\xa9.txt",
sizel=(1,2),
pointl=(3,4),
--- 161,165 ----
ftLastWriteTime=pythoncom.MakeTime(12),
nFileSize=sys_maxsize + 1),
! dict(cFileName="foo\xa9.txt",
sizel=(1,2),
pointl=(3,4),
Index: testMSOffice.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testMSOffice.py,v
retrieving revision 1.7.4.2
retrieving revision 1.7.4.3
diff -C2 -d -r1.7.4.2 -r1.7.4.3
*** testMSOffice.py 26 Nov 2008 09:03:29 -0000 1.7.4.2
--- testMSOffice.py 27 Nov 2008 04:58:41 -0000 1.7.4.3
***************
*** 104,122 ****
xl.Cells(i+1,i+1).Value = "Hi %d" % i
! if xl.Range("A1").Value <> "Hi 0":
raise error("Single cell range failed")
! if xl.Range("A1:B1").Value <> ((Unicode("Hi 0"),2),):
raise error("flat-horizontal cell range failed")
! if xl.Range("A1:A2").Value <> ((Unicode("Hi 0"),),(Unicode("x"),)):
raise error("flat-vertical cell range failed")
! if xl.Range("A1:C3").Value <> ((Unicode("Hi 0"),2,3),(Unicode("x"),Unicode("Hi 1"),Unicode("z")),(3,2,Unicode("Hi 2"))):
raise error("square cell range failed")
xl.Range("A1:C3").Value =((3,2,1),("x","y","z"),(1,2,3))
! if xl.Range("A1:C3").Value <> ((3,2,1),(Unicode("x"),Unicode("y"),Unicode("z")),(1,2,3)):
raise error("Range was not what I set it to!")
--- 104,122 ----
xl.Cells(i+1,i+1).Value = "Hi %d" % i
! if xl.Range("A1").Value != "Hi 0":
raise error("Single cell range failed")
! if xl.Range("A1:B1").Value != ((Unicode("Hi 0"),2),):
raise error("flat-horizontal cell range failed")
! if xl.Range("A1:A2").Value != ((Unicode("Hi 0"),),(Unicode("x"),)):
raise error("flat-vertical cell range failed")
! if xl.Range("A1:C3").Value != ((Unicode("Hi 0"),2,3),(Unicode("x"),Unicode("Hi 1"),Unicode("z")),(3,2,Unicode("Hi 2"))):
raise error("square cell range failed")
xl.Range("A1:C3").Value =((3,2,1),("x","y","z"),(1,2,3))
! if xl.Range("A1:C3").Value != ((3,2,1),(Unicode("x"),Unicode("y"),Unicode("z")),(1,2,3)):
raise error("Range was not what I set it to!")
Index: testGIT.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testGIT.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
*** testGIT.py 26 Nov 2008 09:03:29 -0000 1.1.4.1
--- testGIT.py 27 Nov 2008 04:58:41 -0000 1.1.4.2
***************
*** 28,32 ****
def TestInterp(interp):
! if interp.Eval("1+1") <> 2:
raise ValueError("The interpreter returned the wrong result.")
try:
--- 28,32 ----
def TestInterp(interp):
! if interp.Eval("1+1") != 2:
raise ValueError("The interpreter returned the wrong result.")
try:
Index: testDynamic.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testDynamic.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
*** testDynamic.py 26 Nov 2008 09:03:29 -0000 1.3.4.1
--- testDynamic.py 27 Nov 2008 04:58:41 -0000 1.3.4.2
***************
*** 53,62 ****
client.ANewAttr = "Hello"
if client.ANewAttr != "Hello":
! raise error, "Could not set dynamic property"
v = ["Hello","From","Python",1.4]
client.TestSequence = v
if v != list(client.TestSequence):
! raise error, "Dynamic sequences not working! %r/%r" % (repr(v), repr(client.testSequence))
client.write("This","output","has","come","via","COM")
--- 53,62 ----
client.ANewAttr = "Hello"
if client.ANewAttr != "Hello":
! raise error("Could not set dynamic property")
v = ["Hello","From","Python",1.4]
client.TestSequence = v
if v != list(client.TestSequence):
! raise error("Dynamic sequences not working! %r/%r" % (repr(v), repr(client.testSequence)))
client.write("This","output","has","come","via","COM")
***************
*** 64,68 ****
client._FlagAsMethod("NotReallyAMethod")
if not callable(client.NotReallyAMethod):
! raise error, "Method I flagged as callable isn't!"
--- 64,68 ----
client._FlagAsMethod("NotReallyAMethod")
if not callable(client.NotReallyAMethod):
! raise error("Method I flagged as callable isn't!")
Index: testClipboard.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testClipboard.py,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -C2 -d -r1.2.4.1 -r1.2.4.2
*** testClipboard.py 26 Nov 2008 07:17:39 -0000 1.2.4.1
--- testClipboard.py 27 Nov 2008 04:58:41 -0000 1.2.4.2
***************
*** 50,54 ****
elif cf == win32con.CF_UNICODETEXT:
ret_stg = pythoncom.STGMEDIUM()
! ret_stg.set(pythoncom.TYMED_HGLOBAL, unicode(self.strval))
if ret_stg is None:
--- 50,54 ----
elif cf == win32con.CF_UNICODETEXT:
ret_stg = pythoncom.STGMEDIUM()
! ret_stg.set(pythoncom.TYMED_HGLOBAL, str(self.strval))
if ret_stg is None:
***************
*** 116,120 ****
# Now check unicode
got = win32clipboard.GetClipboardData(win32con.CF_UNICODETEXT)
! self.assertEqual(got, u"Hello from Python")
win32clipboard.CloseClipboard()
--- 116,120 ----
# Now check unicode
got = win32clipboard.GetClipboardData(win32con.CF_UNICODETEXT)
! self.assertEqual(got, "Hello from Python")
win32clipboard.CloseClipboard()
Index: testDictionary.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testDictionary.py,v
retrieving revision 1.6.4.2
retrieving revision 1.6.4.3
diff -C2 -d -r1.6.4.2 -r1.6.4.3
*** testDictionary.py 26 Nov 2008 09:03:29 -0000 1.6.4.2
--- testDictionary.py 27 Nov 2008 04:58:41 -0000 1.6.4.3
***************
*** 20,24 ****
for key, value in check.items():
if dict(key) != value:
! raise error("Indexing for '%s' gave the incorrect value - %s/%s" % (`key`, `dict[key]`, `check[key]`))
# Ensure we have the correct version registered.
--- 20,24 ----
for key, value in check.items():
if dict(key) != value:
! raise error("Indexing for '%s' gave the incorrect value - %s/%s" % (repr(key), repr(dict[key]), repr(check[key])))
# Ensure we have the correct version registered.
|