[Zope-ZEO] Advice

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 25 Sep 2000 10:52:40 +0100


On Fri, 22 Sep 2000 19:54:11 -0400, Andrew Kuchling
<akuchlin@cnri.reston.va.us> wrote:

>  You could write a Python object, test it from the Python
>command-line, and then write a layer of glue on top of it to turn it into a
>Product,

Thats a good strategy - I assume you do (or could) use a similar one
for Quixote applications. 

>  but how do you test the glue?

I assume the strategy for testing Zope-glue is similar to
Quixote-glue.

After perfoming units tests on individual python modules, my test
harness includes a script which does the following:

1. Copy an initial data.fs file from cvs. This file contains a
   starting data set, including old formats of any objects that
   use __setstate__
2. Start Zope on a different port, using DemoStorage;
   http://www.zope.org/Members/jens/docs/zope_on_cdrom
   this stores ZODB writes in memory.
3. Excercise the glue using a mix of xmlrpc (mostly),
   httplib (a little), and sockets (rarely)
4. Stop Zope.

The key to this is (as always) ensuring that your design process
considers the testability of the glue.

Several key technologies can very quickly make this glue untestable if
used unwisely. For example, the DTML namespace - theres so much mixed
up into one mapping object that it can be hard to prove that it always
finds the object. (The other sticky point is Acquisition, combined
with ObjectManager/PropertyManager implementations that modify the
namespace searched by Acquisition)

That doesn't mean it cant be used safely - just that safety doesnt
happen by accident (unlike Python, where I usually find that even code
from the greenest newbie is readable and testable)


Toby Dickenson
tdickenson@geminidataloggers.com