[Zope-Checkins] CVS: Zope3/lib/python/Interface/Registry/tests - testTypeRegistry.py:1.3

Jeremy Hylton jeremy@zope.com
Thu, 5 Sep 2002 17:17:42 -0400


Update of /cvs-repository/Zope3/lib/python/Interface/Registry/tests
In directory cvs.zope.org:/tmp/cvs-serv5660/tests

Modified Files:
	testTypeRegistry.py 
Log Message:
Add test of setdefault().


=== Zope3/lib/python/Interface/Registry/tests/testTypeRegistry.py 1.2 => 1.3 ===
--- Zope3/lib/python/Interface/Registry/tests/testTypeRegistry.py:1.2	Thu Aug  1 12:06:41 2002
+++ Zope3/lib/python/Interface/Registry/tests/testTypeRegistry.py	Thu Sep  5 17:17:41 2002
@@ -72,6 +72,15 @@
         self.assertEqual(reg.get(I2), 2)
         self.assertEqual(reg.get(I3), 3)
 
+    def testSetdefault(self):
+        class I(Interface):
+            pass
+        reg = TypeRegistry()
+        x = reg.setdefault(I, 1)
+        y = reg.setdefault(I, 2)
+        self.assertEqual(x, y)
+        self.assertEqual(x, 1)
+
     def testDup(self):
         class I1(Interface): pass
         class I2(I1): pass