[Zope3-checkins] CVS: Products3/zwiki/tests - test_index.py:1.2 test_sourcetype.py:1.3 test_traversable.py:1.4 test_traverser.py:1.4 test_wikidirectives.py:1.3 test_wikimail.py:1.3 test_wikipagehierarchy.py:1.8

Stephan Richter srichter@cbu.edu
Thu, 5 Jun 2003 09:34:26 -0400


Update of /cvs-repository/Products3/zwiki/tests
In directory cvs.zope.org:/tmp/cvs-serv27908/src/zopeproducts/zwiki/tests

Modified Files:
	test_index.py test_sourcetype.py test_traversable.py 
	test_traverser.py test_wikidirectives.py test_wikimail.py 
	test_wikipagehierarchy.py 
Log Message:
Updated the Zwiki Product to reflect recent API changes:

- Moved all __implements__ statements to implements()

- Moved zope.context.ContextWrapper to zope.app.context.ContextWrapper

- Moved zope.proxy.introspection.removeAllProxies to 
  zope.proxy.removeAllProxies

- Added a few comments

- Fixed tests

XXX: We still do not have a method for __used_for__; what should I use in
     this case?


=== Products3/zwiki/tests/test_index.py 1.1 => 1.2 ===
--- Products3/zwiki/tests/test_index.py:1.1	Sat Apr 12 19:05:35 2003
+++ Products3/zwiki/tests/test_index.py	Thu Jun  5 09:34:26 2003
@@ -16,6 +16,7 @@
 $Id$
 """
 import unittest
+from zope.interface import implements
 from zope.app.index.text.tests import test_index
 from zope.app.interfaces.index.text import ISearchableText
 from zope.app.services.tests.placefulsetup import PlacefulSetup
@@ -25,7 +26,7 @@
 
 
 class FakeSearchableObject:
-    __implements__ = ISearchableText, IWikiPage
+    implements(ISearchableText, IWikiPage)
 
     def __init__(self):
         self.texts = [u"Bruce"]


=== Products3/zwiki/tests/test_sourcetype.py 1.2 => 1.3 ===
--- Products3/zwiki/tests/test_sourcetype.py:1.2	Sat Apr 12 19:05:35 2003
+++ Products3/zwiki/tests/test_sourcetype.py	Thu Jun  5 09:34:26 2003
@@ -17,7 +17,7 @@
 """
 import unittest
 
-from zope.interface import Interface
+from zope.interface import Interface, implements
 from zopeproducts.zwiki.interfaces import IGlobalWikiSourceTypeService
 from zopeproducts.zwiki.sourcetype import GlobalWikiSourceTypeService
 
@@ -26,13 +26,13 @@
     pass
 
 class Foo(unicode):
-    __implements__ = IFoo
+    implements(IFoo)
 
 class IFoo2(Interface):
     pass
 
 class Foo2(unicode):
-    __implements__ = IFoo2
+    implements(IFoo2)
 
 
 class TestGlobalWikiSourceTypeService(unittest.TestCase):


=== Products3/zwiki/tests/test_traversable.py 1.3 => 1.4 ===
--- Products3/zwiki/tests/test_traversable.py:1.3	Wed May 28 02:53:47 2003
+++ Products3/zwiki/tests/test_traversable.py	Thu Jun  5 09:34:26 2003
@@ -18,7 +18,7 @@
 import unittest, sys
 from zope.exceptions import NotFoundError
 from zope.testing.cleanup import CleanUp
-from zope.context import ContextWrapper
+from zope.app.context import ContextWrapper
 
 from zopeproducts.zwiki.wiki import Wiki
 from zopeproducts.zwiki.wikipage import WikiPage


=== Products3/zwiki/tests/test_traverser.py 1.3 => 1.4 ===
--- Products3/zwiki/tests/test_traverser.py:1.3	Wed May 28 02:53:47 2003
+++ Products3/zwiki/tests/test_traverser.py	Thu Jun  5 09:34:26 2003
@@ -23,8 +23,8 @@
 from zope.interface import Interface
 from zope.exceptions import NotFoundError
 from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.proxy.introspection import removeAllProxies
-from zope.context import ContextWrapper
+from zope.proxy import removeAllProxies
+from zope.app.context import ContextWrapper
 
 from zopeproducts.zwiki.interfaces import IWikiPage
 from zopeproducts.zwiki.wiki import Wiki


=== Products3/zwiki/tests/test_wikidirectives.py 1.2 => 1.3 ===
--- Products3/zwiki/tests/test_wikidirectives.py:1.2	Sat Apr 12 19:05:35 2003
+++ Products3/zwiki/tests/test_wikidirectives.py	Thu Jun  5 09:34:26 2003
@@ -20,7 +20,7 @@
 
 from cStringIO import StringIO
 
-from zope.interface import Interface
+from zope.interface import Interface, implements
 from zope.component.tests.placelesssetup import PlacelessSetup
 from zope.configuration.xmlconfig import xmlconfig, Context, XMLConfig
 from zope.configuration.exceptions import ConfigurationError
@@ -44,11 +44,10 @@
     pass
 
 class TestSource(unicode):
-    __implements__ = ITestSource
+    implements(ITestSource)
     
 
 class TestRenderer(BrowserView):
-    __implements__ = BrowserView.__implements__
     __used_for__ = ITestSource
 
 


=== Products3/zwiki/tests/test_wikimail.py 1.2 => 1.3 ===
--- Products3/zwiki/tests/test_wikimail.py:1.2	Wed May 28 02:53:47 2003
+++ Products3/zwiki/tests/test_wikimail.py	Thu Jun  5 09:34:26 2003
@@ -17,11 +17,12 @@
 """
 import unittest
 
-from zope.context import ContextWrapper
+from zope.interface.implements import implements 
 from zope.component.adapter import provideAdapter
 from zope.component.tests.placelesssetup import PlacelessSetup
 from zope.app.interfaces.annotation import IAnnotations, IAttributeAnnotatable
 from zope.app.interfaces.event import ISubscriber
+from zope.app.context import ContextWrapper
 from zope.app.attributeannotations import AttributeAnnotations
 
 from zopeproducts.zwiki.interfaces import IWikiPage, IWiki, IMailSubscriptions
@@ -41,10 +42,8 @@
         PlacelessSetup.setUp(self)
         # This needs to be done, since the IAttributeAnnotable interface
         # is usually set in the ZCML
-        WikiPage.__implements__ = (WikiPage.__implements__,
-                                   IAttributeAnnotatable)
-        Wiki.__implements__ = (Wiki.__implements__,
-                                   IAttributeAnnotatable)
+        implements(WikiPage, IAttributeAnnotatable)
+        implements(Wiki, IAttributeAnnotatable)
         provideAdapter(IAttributeAnnotatable, IAnnotations,
                        AttributeAnnotations)
         self._sub = MailSubscriptions(self.getTestObject())
@@ -106,18 +105,12 @@
         PlacelessSetup.setUp(self)
         # This needs to be done, since the IAttributeAnnotable interface
         # is usually set in the ZCML
-        WikiPage.__implements__ = (WikiPage.__implements__,
-                                   IAttributeAnnotatable)
-        Wiki.__implements__ = (Wiki.__implements__,
-                                   IAttributeAnnotatable)
+        implements(WikiPage, IAttributeAnnotatable)
+        implements(Wiki, IAttributeAnnotatable)
         provideAdapter(IWikiPage, IMailSubscriptions,
                        MailSubscriptions)
         provideAdapter(IWiki, IMailSubscriptions,
                        MailSubscriptions)
-        WikiPage.__implements__ = (WikiPage.__implements__,
-                                   IAttributeAnnotatable)
-        Wiki.__implements__ = (Wiki.__implements__,
-                                   IAttributeAnnotatable)
         provideAdapter(IAttributeAnnotatable, IAnnotations,
                        AttributeAnnotations)
 


=== Products3/zwiki/tests/test_wikipagehierarchy.py 1.7 => 1.8 ===
--- Products3/zwiki/tests/test_wikipagehierarchy.py:1.7	Wed May 28 02:53:47 2003
+++ Products3/zwiki/tests/test_wikipagehierarchy.py	Thu Jun  5 09:34:26 2003
@@ -20,19 +20,21 @@
 from zopeproducts.zwiki.interfaces import IWikiPage, IWikiPageHierarchy
 from zopeproducts.zwiki.wikipage import WikiPage, WikiPageHierarchyAdapter
 from zopeproducts.zwiki.wiki import Wiki
+from zope.interface import implements
+from zope.interface.implements import implements as late_implements
 from zope.component.tests.placelesssetup import PlacelessSetup
 from zope.component.adapter import provideAdapter
 
 from zope.app.interfaces.annotation import IAnnotations, IAttributeAnnotatable
 from zope.app.interfaces.traversing import IObjectName
 
-from zope.context import ContextWrapper
+from zope.app.context import ContextWrapper
 from zope.app.attributeannotations import AttributeAnnotations
 from zope.app.traversing.adapters import ObjectName
 
 
 class TestAnnotations(dict):
-    __implements__ = IAnnotations
+    implements(IAnnotations)
 
 
 class Test(PlacelessSetup, unittest.TestCase):
@@ -41,8 +43,7 @@
         PlacelessSetup.setUp(self)
         # This needs to be done, since the IAttributeAnnotable interface
         # is usually set in the ZCML
-        WikiPage.__implements__ = (WikiPage.__implements__,
-                                   IAttributeAnnotatable)
+        late_implements(WikiPage, IAttributeAnnotatable);
         provideAdapter(IAttributeAnnotatable, IAnnotations,
                        AttributeAnnotations)
         provideAdapter(IWikiPage, IWikiPageHierarchy,