- More Zope adventures
I'm working on a new project -- I'm trying to develop a set of tools that I can use to test Zope products -- in effect, marrying Steve Purcell's PyUnit with Zope. My objective is to create a set of unit tests for any Zope product or even internal Zope components... which will then enable me to do XP-style refactoring stuff for my Zope projects...
I've thought about several approaches (including doing this via the medusa monitor) but I think the best approach is to access Zope objects via the publish_module methods in the ZPublisher module...Of course, the downside of this approach is that I can't test the ZServer side of the Zope stuff -- but since I'm not likely to be doing anything on that part of Zope, this is just fine for me (and probably for a lot of other Zope developers as well).
Where I am now: I've gotten to the point where I can call any object via its url string (e.g. '/index_html') and get the HTML output. I think I can use this to build a coarse-grained unit testing framework -- I can capture the HTML output, stick in some file, then run the unit test by comparing the HTML output from current run with the HTML output from a file...
Where I'd like to get to: I want to be able to access the actual objects and call their individual methods (e.g. -- DTMLMethodObject1.__call__(client, REQUEST, RESPONSE,...)). Then I can do fine-grained unit tests.
One of the things I need to add is some setup routines to create fresh copies of the ZODB -- I can't get a ZODB to get back to its original state even if i start undoing transactions and packing it...I've also tried deleting everything and packing... its just not at the same size as it was before...
More Later...
