[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser/tests - testAttributePublisher.py:1.1.2.7
Martijn Pieters
mj@zope.com
Tue, 27 Nov 2001 17:00:35 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv12674/lib/python/Zope/Publisher/Browser/tests
Modified Files:
Tag: Zope-3x-branch
testAttributePublisher.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/Browser/tests/testAttributePublisher.py 1.1.2.6 => 1.1.2.7 ===
from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
+from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
+
+from Interface import verify, instancesOfObjectImplements
class Presentation(AttributePublisher):
index = 'index'
@@ -19,6 +22,13 @@
class TestAttributePublisher(unittest.TestCase):
def setUp(self):
self.pres = Presentation()
+
+ def testImplementsIBrowserPublisher(self):
+ self.failUnless(IBrowserPublisher.isImplementedBy(self.pres))
+
+ def testInterfacesVerify(self):
+ for interface in instancesOfObjectImplements(Presentation):
+ verify(interface, Presentation)
def testBrowserDefault(self):
self.assertEquals(self.pres.browser_default(None),