Uninstalling a product in a ZopeTestCase
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
Marco Bizzarri wrote at 2005-8-19 10:49 +0200: You may look how the "refresh Product" function uninstalls a product. You find the code in "App.RefreshFuncs.performRefresh". -- Dieter
participants (2)
-
Dieter Maurer -
Marco Bizzarri