[Zope-CVS] CVS: Products/ZCTextIndex/tests - testSetOps.py:1.2
Tim Peters
tim.one@comcast.net
Tue, 14 May 2002 20:43:16 -0400
Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv29638/tests
Modified Files:
testSetOps.py
Log Message:
Simplified testPairs() a tad.
=== Products/ZCTextIndex/tests/testSetOps.py 1.1 => 1.2 ===
def testPairs(self):
- # Construct a pair with one key in common.
t1 = IIBTree([(1, 10), (3, 30), (7, 70)])
t2 = IIBTree([(3, 30), (5, 50), (7, 7), (9, 90)])
allkeys = [1, 3, 5, 7, 9]
@@ -75,7 +74,7 @@
expected = []
for key in allkeys:
if x.has_key(key) and y.has_key(key):
- result = x.get(key, 0) * w1 + y.get(key, 0) * w2
+ result = x[key] * w1 + y[key] * w2
expected.append((key, result))
expected.sort()
got = mass_weightedIntersection([(x, w1), (y, w2)])