[Zope3-dev] testing interfaces / Cookbook

yuppie y.2004_ at wcm-solutions.de
Mon Apr 19 04:30:15 EDT 2004


Hi!


The Cookbook uses this example

     def test_interface(self):
         self.assert_(IMessageBoard.isImplementedBy(
             self.makeTestObject()))

Does it make sense to use providedBy (fka isImplementedBy) in unittests? 
Wouldn't it be better to verify the interface?

     def test_interface(self):
         verifyObject(IMessageBoard, self.makeTestObject()))

or

     def test_interface(self):
         verifyClass(IMessageBoard, MessageBoard)


Grepping through zope3 unittests shows all patterns are used:

providedBy: 171 matches
verifyObject: 132 matches
verifyClass: 132 matches


Cheers,
	Yuppie




More information about the Zope3-dev mailing list