[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/component/tests.py Fixed some assumptions about return types.

Jim Fulton jim at zope.com
Tue Feb 28 17:38:38 EST 2006


Log message for revision 65618:
  Fixed some assumptions about return types.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/component/tests.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/component/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/tests.py	2006-02-28 22:38:34 UTC (rev 65617)
+++ Zope3/branches/jim-adapter/src/zope/component/tests.py	2006-02-28 22:38:38 UTC (rev 65618)
@@ -514,8 +514,7 @@
     Now we get all the adapters that are registered for `ob` that provide
     `I2`:
 
-      >>> adapters = component.getAdapters((ob,), I2)
-      >>> adapters.sort()
+      >>> adapters = sorted(component.getAdapters((ob,), I2))
       >>> [(name, adapter.__class__.__name__) for name, adapter in adapters]
       [(u'', 'Comp'), (u'foo', 'Comp')]
 
@@ -524,8 +523,7 @@
 
       >>> component.getGlobalSiteManager().provideAdapter(
       ...     [I1], I2, 'nah', lambda context: None)
-      >>> adapters = component.getAdapters((ob,), I2)
-      >>> adapters.sort()
+      >>> adapters = sorted(component.getAdapters((ob,), I2))
       >>> [(name, adapter.__class__.__name__) for name, adapter in adapters]
       [(u'', 'Comp'), (u'foo', 'Comp')]
 
@@ -623,8 +621,7 @@
     We can now get all the utilities that provide interface `I1`:
 
       >>> uts = list(component.getAllUtilitiesRegisteredFor(I1))
-      >>> uts = [util.__class__.__name__ for util in uts]
-      >>> uts.sort()
+      >>> uts = sorted([util.__class__.__name__ for util in uts])
       >>> uts
       ['Ob', 'Ob', 'Ob11']
 



More information about the Zope3-Checkins mailing list