[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/tests - testPublisher.py:1.1.2.3

Martijn Pieters mj@zope.com
Tue, 27 Nov 2001 17:00:35 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/tests
In directory cvs.zope.org:/tmp/cvs-serv12674/lib/python/Zope/Publisher/tests

Modified Files:
      Tag: Zope-3x-branch
	testPublisher.py 
Log Message:
Add interface tests; does the object implement the correct interface and does
it implement all the claimed interfaces correctly (for a certain definition of
correctly..).


=== Zope3/lib/python/Zope/Publisher/tests/testPublisher.py 1.1.2.2 => 1.1.2.3 ===
 from Zope.Publisher.DefaultPublication import DefaultPublication
 from Zope.Publisher.Exceptions import Retry
+from Zope.Publisher.IPublication import IPublication
+
+from Interface import verify, instancesOfObjectImplements
 
 from StringIO import StringIO
 
@@ -49,6 +52,13 @@
         request = self._createRequest(path)
         publish(request)
         return request.response.outstream.getvalue()
+
+    def testImplementsIPublication(self):
+        self.failUnless(IPublication.isImplementedBy(DefaultPublication(self.app))
+
+    def testInterfacesVerify(self):
+        for interface in instancesOfObjectImplements(Presentation):
+            verify(interface, Presentation)
 
     def testTraversalToItem(self):
         res = self._publisherResults('/folder/item')