[Plone-IT] unit testing con Plone 3.1.1

luigi scarso luigi.scarso a gmail.com
Mar 20 Maggio 2008 14:24:48 UTC


Salve,
ho creato un progetto con
$>/opt/Plone-3.1/Python-2.4/bin/paster create -t plone dueufficio.catalog

Nella cartella /dueufficio/catalogo
ho creato la cartella test nella quale
ho copiato e banalmente modificato il tests.py standard
aggiungendo due metodi

def test_nopass(self):
  self.assertEquals(1,0)

def test_pass(self):
  self.assertEquals(1,1)

**Ogni** volta che lancio i test con
$> /opt/Plone-3.1/zeocluster/bin/client1 test  -s dueufficio.catalog
--path=/opt/Plone-3.1/zeocluster/src/dueufficio.catalog
ottengo:

===================================================
Running tests at level 1
Installing CMFCore ... done (0.244s)
Installing CMFDefault ... done (0.226s)
Installing CMFCalendar ... done (0.064s)
Installing CMFTopic ... done (0.017s)
Installing DCWorkflow ... done (0.039s)
Installing CMFActionIcons ... done (0.016s)
Installing CMFQuickInstallerTool ... done (0.045s)
Installing CMFFormController ... done (0.263s)
Installing GroupUserFolder ... done (0.301s)
Installing ZCTextIndex ... done (0.050s)
Installing CMFPlone ... done (2.351s)
Installing Archetypes ... done (0.085s)
Installing ATContentTypes ... done (0.032s)
Installing ATReferenceBrowserWidget ... done (0.011s)
Installing CMFDynamicViewFTI ...
...
...
...
ed un bel po' di warnings
/opt/Plone-3.1/zeocluster/parts/plone/GenericSetup/registry.py:744:
DeprecationWarning: Version for profile
Products.PortalTransforms:PortalTransforms taken from version.txt.
This is deprecated behaviour and will be removed in GenericSetup 1.5:
please specify the version in metadata.xml.
  DeprecationWarning)
  Set up Products.PloneTestCase.layer.ZCML in 5.020 seconds.
/opt/Plone-3.1/zeocluster/parts/plone/PlonePAS/setuphandlers.py:39:
DeprecationWarning: portal_groups.getGroupIds is deprecated and will
be removed in Plone 3.5. Use PAS searchGroups instead
  existing = gtool.listGroupIds()
  Set up Products.PloneTestCase.layer.PloneSite in 5.781 seconds.
  Set up dueufficio.catalog.tests.test-sample.layer in 0.001 seconds.
  Running:
.

Failure in test test_nopass (dueufficio.catalog.tests.test-sample.TestCase)
Traceback (most recent call last):
  File "/opt/Plone-3.1/zeocluster/parts/zope2/lib/python/Testing/ZopeTestCase/profiler.py",
line 98, in __call__
    testMethod()
  File "/opt/Plone-3.1/zeocluster/src/dueufficio.catalog/dueufficio/catalog/tests/test-sample.py",
line 33, in test_nopass
    self.assertEquals(1,0)
  File "/opt/Plone-3.1/Python-2.4/lib/python2.4/unittest.py", line
333, in failUnlessEqual
    raise self.failureException, \
AssertionError: 1 != 0

.
  Ran 2 tests with 1 failures and 0 errors in 0.044 seconds.
Tearing down left over layers:
========================

E' possibile eliminare tutti gli
Installing..
iniziali ?
Perche' ho tutti questi Warning ?


Grazie in anticipo

-- 
luigi




Maggiori informazioni sulla lista Plone-IT