[Zope] Uninstalling a product in a ZopeTestCase

Marco Bizzarri m.bizzarri at icube.it
Fri Aug 19 04:49:54 EDT 2005


Hi all.

I'm trying to write a ZopeTestCase where I can check if the import of a 
missing module is catch or no. I would therefore test something like this:

     def testImportIsCaught(self):
         import sys
         oo_path = filter(lambda x: 'program' in x, sys.path)
         sys.path.remove(oo_path[0])
         ZopeTestCase.installProduct('PAFlow')


What I'm doing here is to remove the path where the openoffice support 
is in the system, and then I try to install the product. If the 
exception import is caught, this should not raise an exception.

The problem is that if I run all the tests, I will end with my product 
already installed, and, therefore, the test won't be run correctly.

Do anyone has any suggestion?

Regards
Marco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m.bizzarri.vcf
Type: text/x-vcard
Size: 328 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050819/c32f22e5/m.bizzarri.vcf


More information about the Zope mailing list