[Zope-CMF] Re: CachingPolicyManager improvements

Tres Seaver tseaver at palladion.com
Fri Sep 2 18:42:56 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jens Vagelpohl wrote:

>> I have written unit tests for all the new functionality including  what I
>> believe to be the first CMFCore test suite to use ZopeTestCase.
>> ZopeTestCase provides a lot of useful functionality, including
>> functional tests, that I think will make for easier test writing going
>> forward.
>>
>> Is there anything I need to do before checking it in?
> 
> 
> Since this involves several pieces I would create a branch in 
> Subversion and put it there for the moment so that everyone can take  a
> good look.
> 
> IMHO there is at least one problematic item (well, it's not for the 
> trunk, but for the 1.5/1.4 branches), which is the dependency on 
> ZopeTestCase. The way the code works right now you immediately  prevent
> any tests from running on platforms that do not have  ZopeTestCase
> installed - it blows up the testrunner. That needs to  degrade a bit
> more gracefully in the absence of ZopeTestCase.

How about:

  try:
      import ZopeTestCase
  except ImportError:
      _ZTC_IMPORTED = 0
  else:
      _ZTC_IMPORTED = 1

and then have things which depend on ZopeTestCase be wrapped inside a
test, e.g.::

  if _ZTC_IMPORTED:  # instead of:  if 1:
      ztc_common = 'ztc_common.py'
      ...

I'm not quite wure what ZTC buys us for unit testing;  is it primarily
used to get the environment right for a functional test?  Is it needed
when running the tests via 'bin/zopectl test' in an instance home?


> On the other hand there are items I would consider fit for merging 
> immediately, such as all the added header handling in the 
> CachingPolicyManager. The 1.5 branch is currently under "lockdown" 
> until Sunday when I will tag CMF 1.5.4 final.

Cool.


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDGNVw+gerLs4ltQ4RAjRbAJ469nW4jTUT8dM8wl9btDk6cvgd6QCfSHzP
k9iIYKwSEVKnRkxKLBoGCuo=
=ticP
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list