[Zope3-dev] RolePermissions UI broken

Martijn Pieters mj@zope.com
Sat, 16 Feb 2002 20:13:23 -0500


On Fri, Feb 15, 2002 at 06:54:25PM +0000, Steve Alexander wrote:
> Further problems... we really need to run something as part of the unit 
> test suite that checks that a component implements the methods of the 
> interfaces it declares it implements.

The Interfaces package has good support for this which I used in the tests
for the Traverser implementation:

  http://cvs.zope.org/Zope3/lib/python/Zope/App/Traversing/tests/Attic/testTraverser.py?rev=1.1.2.7&content-type=text/vnd.viewcvs-markup&only_with_tag=Zope-3x-branch

or lib/python/Zope/App/Traversing/tests/testTraverser.py in your Zope3
sandbox.

testImplementsITraverser tests the expectation that the ITraverser interface
is implemented by the object; testVerifyInterfaces tests if the interfaces
that the object *claims* it implements are indeed fully implemented. Further
down you'll see testImplementsITraversable as another example.

Any testsuite that applies to any object that implements a certain interface
should use such tests to keep Interface and implementations in sync.

-- 
Martijn Pieters
| Software Engineer  mailto:mj@zope.com
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------