[Zope-Checkins] CVS: Zope/lib/python/BTrees/tests - testSetOps.py:1.11

Tim Peters tim.one@comcast.net
Tue, 25 Jun 2002 15:40:11 -0400


Update of /cvs-repository/Zope/lib/python/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv2821/tests

Modified Files:
	testSetOps.py 
Log Message:
Repaired more of the weightedIntersection and weightedUnion docs.  I'm
not sure it's telling the full truth yet.


=== Zope/lib/python/BTrees/tests/testSetOps.py 1.10 => 1.11 ===
 from BTrees.OIBTree import OIBTree, OIBucket, OISet, OITreeSet
 
-# XXX TODO Needs more tests.
-# This file was created when multiunion was added.  The other set operations
-# don't appear to be tested anywhere yet.
-
 # Subclasses have to set up:
 #     builders - functions to build inputs, taking an optional keys arg
 #     intersection, union, difference - set to the type-correct versions
@@ -386,6 +382,12 @@
 class TestWeightedOI(Weighted):
     from BTrees.OIBTree import weightedUnion, weightedIntersection
     builders = OIBucket, OIBTree, itemsToSet(OISet), itemsToSet(OITreeSet)
+
+
+# 'thing' is a bucket, btree, set or treeset.  Return true iff it's one of the
+# latter two.
+def isaset(thing):
+    return not hasattr(thing, 'values')
 
 
 def test_suite():