[Zope3-dev] testing interfaces / Cookbook

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Apr 25 00:45:32 EDT 2004


On Monday 19 April 2004 04:30, yuppie wrote:
> 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?

It depends. If the object initiates all of its attributes in the constructor 
(__init__()), then verifyObject/Class will fail, since they cannot find the 
attributes.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training



More information about the Zope3-dev mailing list