[Zope-CVS] CVS: Packages/pypes/pypes/tests - test_identity.py:1.11

Casey Duncan casey at zope.com
Mon Mar 1 23:14:29 EST 2004


Update of /cvs-repository/Packages/pypes/pypes/tests
In directory cvs.zope.org:/tmp/cvs-serv11710/tests

Modified Files:
	test_identity.py 
Log Message:
Add small optimization for __eq__ and __ne__ for identity sets


=== Packages/pypes/pypes/tests/test_identity.py 1.10 => 1.11 ===
--- Packages/pypes/pypes/tests/test_identity.py:1.10	Sun Feb 29 00:44:48 2004
+++ Packages/pypes/pypes/tests/test_identity.py	Mon Mar  1 23:14:27 2004
@@ -606,7 +606,15 @@
         self.failUnless(set1.issuperset(set2))
         self.failUnless(set2.issuperset(set1))
         self.assertEqual(set1, set2)
-
+    
+    def testSetEqualToSelf(self):
+        from pypes.identity import IdentitySet
+        objs = [self._newObj() for i in xrange(10)]
+        set1 = IdentitySet(objs)
+        self.assertEqual(set1, set1)
+        self.failIf(set1 != set1)
+        self.failUnless(set1.issubset(set1))
+        self.failUnless(set1.issuperset(set1))
 
 class TestMultiSetOps(PypesTestCase):
     




More information about the Zope-CVS mailing list