[Zope3-checkins] CVS: Zope3/src/zope/component/tests - test_adapter.py:1.3

Jim Fulton jim at zope.com
Mon Mar 15 15:42:54 EST 2004


Update of /cvs-repository/Zope3/src/zope/component/tests
In directory cvs.zope.org:/tmp/cvs-serv3799/src/zope/component/tests

Modified Files:
	test_adapter.py 
Log Message:
Factory semantics are now provided by the adapter service, rather than
the underlying adapter registry. These semantics are provided in a
mix-in class.

Only a single factory can be provided.

Changed the registration api to be consistent with the underlying
adapter registry api and, in general, to be simpler.


=== Zope3/src/zope/component/tests/test_adapter.py 1.2 => 1.3 ===
--- Zope3/src/zope/component/tests/test_adapter.py:1.2	Fri Nov 21 12:09:20 2003
+++ Zope3/src/zope/component/tests/test_adapter.py	Mon Mar 15 15:42:24 2004
@@ -37,9 +37,9 @@
     def getRegistry(self):
         registry = GlobalAdapterService()
 
-        registry.provideAdapter(None, P3, [default_P3])
-        registry.provideAdapter(Interface, P3, [any_P3])
-        registry.provideAdapter(R2, P3, [R2_P3])
+        registry.register([None], P3, '', default_P3)
+        registry.register([Interface], P3, '', any_P3)
+        registry.register([R2], P3, '', R2_P3)
 
         return registry
     
@@ -49,9 +49,9 @@
         got = list(registry.getRegisteredMatching())
         got.sort()
         expect = [
-            (Interface, P3, (), u'', [any_P3]),
-            (R2, P3, (), u'', [R2_P3]),
-            (None, P3, (), u'', [default_P3]),
+            (Interface, P3, (), u'', any_P3),
+            (R2, P3, (), u'', R2_P3),
+            (None, P3, (), u'', default_P3),
             ]
         expect.sort()
         self.assertEqual(got, expect)
@@ -64,8 +64,8 @@
             ))
         got.sort()
         expect = [
-            (Interface, P3, (), u'', [any_P3]),
-            (None, P3, (), u'', [default_P3]),
+            (Interface, P3, (), u'', any_P3),
+            (None, P3, (), u'', default_P3),
             ]
         expect.sort()
         self.assertEqual(got, expect)
@@ -78,9 +78,9 @@
             ))
         got.sort()
         expect = [
-            (Interface, P3, (), u'', [any_P3]),
-            (R2, P3, (), u'', [R2_P3]),
-            (None, P3, (), u'', [default_P3]),
+            (Interface, P3, (), u'', any_P3),
+            (R2, P3, (), u'', R2_P3),
+            (None, P3, (), u'', default_P3),
             ]
         expect.sort()
         self.assertEqual(got, expect)
@@ -94,9 +94,9 @@
 
         got.sort()
         expect = [
-            (Interface, P3, (), u'', [any_P3]),
-            (R2, P3, (), u'', [R2_P3]),
-            (None, P3, (), u'', [default_P3]),
+            (Interface, P3, (), u'', any_P3),
+            (R2, P3, (), u'', R2_P3),
+            (None, P3, (), u'', default_P3),
             ]
         expect.sort()
         self.assertEqual(got, expect)
@@ -109,9 +109,9 @@
             ))
         got.sort()
         expect = [
-            (Interface, P3, (), u'', [any_P3]),
-            (R2, P3, (), u'', [R2_P3]),
-            (None, P3, (), u'', [default_P3]),
+            (Interface, P3, (), u'', any_P3),
+            (R2, P3, (), u'', R2_P3),
+            (None, P3, (), u'', default_P3),
             ]
         expect.sort()
         self.assertEqual(got, expect)
@@ -125,9 +125,9 @@
             ))
         got.sort()
         expect = [
-            (Interface, P3, (), u'', [any_P3]),
-            (R2, P3, (), u'', [R2_P3]),
-            (None, P3, (), u'', [default_P3]),
+            (Interface, P3, (), u'', any_P3),
+            (R2, P3, (), u'', R2_P3),
+            (None, P3, (), u'', default_P3),
             ]
         expect.sort()
         self.assertEqual(got, expect)
@@ -141,9 +141,9 @@
             ))
         got.sort()
         expect = [
-            (Interface, P3, (), u'', [any_P3]),
-            (R2, P3, (), u'', [R2_P3]),
-            (None, P3, (), u'', [default_P3]),
+            (Interface, P3, (), u'', any_P3),
+            (R2, P3, (), u'', R2_P3),
+            (None, P3, (), u'', default_P3),
             ]
         expect.sort()
         self.assertEqual(got, expect)
@@ -157,9 +157,9 @@
             ))
         got.sort()
         expect = [
-            (Interface, P3, (), u'', [any_P3]),
-            (R2, P3, (), u'', [R2_P3]),
-            (None, P3, (), u'', [default_P3]),
+            (Interface, P3, (), u'', any_P3),
+            (R2, P3, (), u'', R2_P3),
+            (None, P3, (), u'', default_P3),
             ]
         expect.sort()
         self.assertEqual(got, expect)




More information about the Zope3-Checkins mailing list