Re: [Zope] Uninstalling a product in a ZopeTestCase

2005-08-19 Thread Dieter Maurer
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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Uninstalling a product in a ZopeTestCase

2005-08-19 Thread Marco Bizzarri

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
begin:vcard
fn:Marco Bizzarri
n:Bizzarri;Marco
org:Icube S.r.l.
adr:;;via Ridolfi 15;Pisa;PI;56124;Italy
email;internet:[EMAIL PROTECTED]
title:Amministratore Delegato
tel;work:+39-050-970-207
tel;fax:+39-050-3136-588
tel;cell:+39-348-640-4861
x-mozilla-html:FALSE
url:http://notenotturne.blogspot.com/
version:2.1
end:vcard

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )