[Checkins] SVN: zc.sharing/trunk/src/zc/sharing/ Get rid of unit test deprecations

Gary Poster gary at zope.com
Thu Apr 27 23:29:05 EDT 2006


Log message for revision 67687:
  Get rid of unit test deprecations
  

Changed:
  U   zc.sharing/trunk/src/zc/sharing/browser/sharing.py
  U   zc.sharing/trunk/src/zc/sharing/browser/sharing.txt
  U   zc.sharing/trunk/src/zc/sharing/interfaces.py
  U   zc.sharing/trunk/src/zc/sharing/policy.txt
  U   zc.sharing/trunk/src/zc/sharing/sharing.py
  U   zc.sharing/trunk/src/zc/sharing/tests.py
  U   zc.sharing/trunk/src/zc/sharing/utils.py
  U   zc.sharing/trunk/src/zc/sharing/zcml.py

-=-
Modified: zc.sharing/trunk/src/zc/sharing/browser/sharing.py
===================================================================
--- zc.sharing/trunk/src/zc/sharing/browser/sharing.py	2006-04-28 03:27:24 UTC (rev 67686)
+++ zc.sharing/trunk/src/zc/sharing/browser/sharing.py	2006-04-28 03:29:04 UTC (rev 67687)
@@ -24,7 +24,7 @@
 import zc.table.interfaces
 from zope import schema, component, interface
 from zope.app import zapi
-from zope.app.location.interfaces import ISublocations
+from zope.location.interfaces import ISublocations
 from zope.interface import Interface
 from zope.interface.common.idatetime import ITZInfo
 from zope.security.interfaces import IGroup

Modified: zc.sharing/trunk/src/zc/sharing/browser/sharing.txt
===================================================================
--- zc.sharing/trunk/src/zc/sharing/browser/sharing.txt	2006-04-28 03:27:24 UTC (rev 67686)
+++ zc.sharing/trunk/src/zc/sharing/browser/sharing.txt	2006-04-28 03:29:04 UTC (rev 67687)
@@ -863,7 +863,7 @@
 example simple, we'll just extend our sample class to support
 sublocations:
 
-    >>> from zope.app.location.interfaces import ISublocations
+    >>> from zope.location.interfaces import ISublocations
     >>> class SharingSampleWithSublocations(SharingSample):
     ...     interface.implements(ISublocations)
     ...     subs = ()

Modified: zc.sharing/trunk/src/zc/sharing/interfaces.py
===================================================================
--- zc.sharing/trunk/src/zc/sharing/interfaces.py	2006-04-28 03:27:24 UTC (rev 67686)
+++ zc.sharing/trunk/src/zc/sharing/interfaces.py	2006-04-28 03:29:04 UTC (rev 67687)
@@ -18,11 +18,11 @@
 """
 
 from zope import interface, schema
-import zope.app.annotation.interfaces
-import zope.app.event.interfaces
-import zope.app.event.objectevent
+import zope.annotation.interfaces
+import zope.lifecycleevent.interfaces
+import zope.lifecycleevent
 
-class ISharable(zope.app.annotation.interfaces.IAttributeAnnotatable):
+class ISharable(zope.annotation.interfaces.IAttributeAnnotatable):
     """Sharable content
 
     Sharable can be adapted to ISharing.
@@ -169,7 +169,7 @@
         Will typically be a zope.i18n.Message.  If None, the registered
         adapter name will be used.''', required=False)
 
-class ISharingEvent(zope.app.event.interfaces.IObjectModifiedEvent):
+class ISharingEvent(zope.lifecycleevent.interfaces.IObjectModifiedEvent):
     "An event fired by the sharing package"
 
 class ISharingChanged(ISharingEvent):
@@ -184,12 +184,12 @@
 
     new = schema.Int(title=u"Old settings")
 
-class SharingChanged(zope.app.event.objectevent.ObjectModifiedEvent):
+class SharingChanged(zope.lifecycleevent.ObjectModifiedEvent):
 
     interface.implements(ISharingChanged)
 
     def __init__(self, object, principal_id, old, new):
-        zope.app.event.objectevent.ObjectModifiedEvent.__init__(self, object)
+        zope.lifecycleevent.ObjectModifiedEvent.__init__(self, object)
         self.principal_id = principal_id
         self.old = old
         self.new = new

Modified: zc.sharing/trunk/src/zc/sharing/policy.txt
===================================================================
--- zc.sharing/trunk/src/zc/sharing/policy.txt	2006-04-28 03:27:24 UTC (rev 67686)
+++ zc.sharing/trunk/src/zc/sharing/policy.txt	2006-04-28 03:29:04 UTC (rev 67687)
@@ -213,9 +213,8 @@
 
     >>> auth = FauxPrincipals()
 
-    >>> from zope.app.tests import ztapi
-    >>> ztapi.provideUtility(IAuthentication, auth)
-    >>> from zope.app import zapi
+    >>> from zope import component
+    >>> component.provideUtility(auth, IAuthentication)
 
 Let's define a group and assign it the read privilege:
 

Modified: zc.sharing/trunk/src/zc/sharing/sharing.py
===================================================================
--- zc.sharing/trunk/src/zc/sharing/sharing.py	2006-04-28 03:27:24 UTC (rev 67686)
+++ zc.sharing/trunk/src/zc/sharing/sharing.py	2006-04-28 03:29:04 UTC (rev 67687)
@@ -25,7 +25,7 @@
 from zope.security.management import queryInteraction
 from zope.publisher.interfaces import IRequest
 
-from zope.app.annotation.interfaces import IAnnotations
+from zope.annotation.interfaces import IAnnotations
 from zope.app.container.interfaces import IObjectAddedEvent
 
 from zc.sharing import interfaces

Modified: zc.sharing/trunk/src/zc/sharing/tests.py
===================================================================
--- zc.sharing/trunk/src/zc/sharing/tests.py	2006-04-28 03:27:24 UTC (rev 67686)
+++ zc.sharing/trunk/src/zc/sharing/tests.py	2006-04-28 03:29:04 UTC (rev 67687)
@@ -18,15 +18,15 @@
 """
 import unittest
 import zope.event
-from zope.app.tests import placelesssetup
+import zope.component
+from zope.app.testing import placelesssetup
 from zope.configuration import xmlconfig
 from zc.sharing import policy
 import zc.sharing
 import zc.sharing.sharing
 import zope.app.security
-from zope.app.tests import ztapi
-import zope.app.annotation.interfaces
-import zope.app.annotation.attribute
+import zope.annotation.interfaces
+import zope.annotation.attribute
 from zope.testing import module
 import zope.security.management
 
@@ -50,10 +50,10 @@
 def setUpSharing(test):
     placelesssetup.setUp()
     module.setUp(test, 'zc.sharing.SHARING')
-    ztapi.provideAdapter(
-        [zope.app.annotation.interfaces.IAttributeAnnotatable],
-        zope.app.annotation.interfaces.IAnnotations,
-        zope.app.annotation.attribute.AttributeAnnotations,
+    zope.component.provideAdapter(
+        zope.annotation.attribute.AttributeAnnotations,
+        [zope.annotation.interfaces.IAttributeAnnotatable],
+        zope.annotation.interfaces.IAnnotations,
         )
     events = test.globs['events'] = []
     zope.event.subscribers.append(events.append)
@@ -86,7 +86,7 @@
     
     >>> sharing.setBinaryPrivileges('bob', 21)
 
-    >>> from zope.app.annotation.interfaces import IAnnotations
+    >>> from zope.annotation.interfaces import IAnnotations
     >>> annotations = IAnnotations(content)
     >>> annotations[zc.sharing.sharing.key].__class__
     <class 'zc.sharing.sharing.SharingData'>

Modified: zc.sharing/trunk/src/zc/sharing/utils.py
===================================================================
--- zc.sharing/trunk/src/zc/sharing/utils.py	2006-04-28 03:27:24 UTC (rev 67686)
+++ zc.sharing/trunk/src/zc/sharing/utils.py	2006-04-28 03:29:04 UTC (rev 67687)
@@ -16,7 +16,7 @@
 
 $Id$
 """
-from zope.app.location.interfaces import ISublocations
+from zope.location.interfaces import ISublocations
 
 from zc.sharing.interfaces import ISharing
 from zc.sharing.sharing import sharingMask

Modified: zc.sharing/trunk/src/zc/sharing/zcml.py
===================================================================
--- zc.sharing/trunk/src/zc/sharing/zcml.py	2006-04-28 03:27:24 UTC (rev 67686)
+++ zc.sharing/trunk/src/zc/sharing/zcml.py	2006-04-28 03:29:04 UTC (rev 67687)
@@ -21,7 +21,7 @@
 
 from zope import component, interface, schema
 import zope.configuration.fields
-import zope.app.security.fields
+import zope.security.zcml
 
 from zc.sharing import policy, sharing, interfaces
 
@@ -56,7 +56,7 @@
 
 class IpermissionPrivilege(interface.Interface):
 
-    permission = zope.app.security.fields.Permission(
+    permission = zope.security.zcml.Permission(
         title=u"Permission",
         description=u"Permission for which a privilege is being defined",
         )



More information about the Checkins mailing list