[Grok-dev] bug in ftesting.zcml ??

Santiago Videla santiago.videla at gmail.com
Sat Apr 26 16:52:59 EDT 2008


Hi,

I made a new grokproject using a clean virtualenv, and then I try to follow
this toturial about testing:

http://grok.zope.org/documentation/how-to/writing%2Cdiscovering%2Crunning-tests-with-z3c.testsetup

When I try to make a functional test, I got the following error:

./bin/test
Running tests at level 1
Running unit tests:
  Running:
..
  Ran 2 tests with 0 failures and 0 errors in 0.005 seconds.
Running sample.testing.FunctionalLayer tests:
  Set up sample.testing.FunctionalLayer Traceback (most recent call last):
  File
"/home/sancho/grok/eggs/tmpH0BX7D/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner.py",
line 1252, in run_layer
  File
"/home/sancho/grok/eggs/tmpH0BX7D/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner.py",
line 1377, in setup_layer
  File
"/home/sancho/grok/eggs/tmpFAB7tb/zope.app.testing-3.4.0a1-py2.4.egg/zope/app/testing/functional.py",
line 196, in setUp
  File
"/home/sancho/grok/eggs/tmpFAB7tb/zope.app.testing-3.4.0a1-py2.4.egg/zope/app/testing/functional.py",
line 129, in __init__
  File
"/home/sancho/grok/eggs/tmphT5Sxo/zope.app.debug-3.4.0a1-py2.4.egg/zope/app/debug/debug.py",
line 36, in __init__
  File
"/home/sancho/grok/eggs/zope.app.appsetup-3.4.1-py2.4.egg/zope/app/appsetup/appsetup.py",
line 111, in config
    context = xmlconfig.file(file, context=context, execute=execute)
  File
"/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py",
line 610, in file
  File
"/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py",
line 546, in include
  File
"/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py",
line 378, in processxmlfile
  File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line
109, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line
123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line
216, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line
364, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File
"/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py",
line 357, in endElementNS
  File
"/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py",
line 542, in end
  File
"/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py",
line 689, in finish
  File
"/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py",
line 1381, in toargs
  File
"/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/fields.py",
line 141, in fromUnicode
ZopeXMLConfigurationError: File
"/home/sancho/grok/Sample/src/sample/ftesting.zcml", line 11.2-13.8
    ConfigurationError: ('Invalid value for', 'component', "ImportError:
Couldn't import zope.app.securitypolicy.zopepolicy, No module named
securitypolicy.zopepolicy")


Tests with errors:
   runTest (zope.testing.testrunner.SetUpLayerFailure)
Total: 2 tests, 0 failures, 1 errors in 2.404 seconds.


I did a little change in Sample/src/sample/ftesting.zcml

from:

  <securityPolicy
      component="*zope.app.*securitypolicy.zopepolicy.ZopeSecurityPolicy"
      />

to:

  <securityPolicy
      component="*zope*.securitypolicy.zopepolicy.ZopeSecurityPolicy"
      />


and now it's working.

it's this ok? it's bug in ftesting.zcml or there is something missing in my
environment?

cheers

-- 
Santiago Videla
www.revolucionesweb.com.ar
http://www.linkedin.com/in/svidela

Sigue la mata dando de que hablar siempre abajo y a la izquierda donde el
pensamiento que se hace corazón resplandece con la palabra sencilla y
humilde que l at s tod at s somos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20080426/15dc3ded/attachment.htm


More information about the Grok-dev mailing list