[Zope-PAS] Unit test errors.

Lennart Regebro regebro at nuxeo.com
Mon Sep 13 10:05:01 EDT 2004


I'm trying to run the unit tests. I know I suceeded last week, but now 
there seems to be new problems.

First of all I'm using Zope-trunks test.py, like this:

bin/zopectl run test.py -v --libdir Products --dir 
Products/PluggableAuthService

This gets the error "Module has no attribute test_suite". This is 
completely correct, so I added:

def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite( theclassname ),
         ))

In all the modules, so that test.py could run them. Is this correct? 
Should I check that in?

Howevere, even with this addition, I get some errors, that I hesitate to 
fix, since I don't know what they are testing, and hence can't tell if 
the bugs are in the tests, or in the software.

Hints are appreciated. ;)

--Lennart


Here are the traceback:

======================================================================
ERROR: test_ICredentialsUpdatePlugin_conformance 
(PluggableAuthService.plugins.tests.test_HTTPBasicAuthHelper.HTTPBasicAuthHelperTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/home/regebro/Zopes/Z272/Products/PluggableAuthService/tests/conformance.py", 
line 69, in test_ICredentialsUpdatePlugin_conformance
     verifyClass( ICredentialsUpdatePlugin, self._getTargetClass() )
   File 
"/home/regebro/Zopes/Zope-2.7.2-0/lib/python/Interface/Verify.py", line 
70, in verifyClass
   File 
"/home/regebro/Zopes/Zope-2.7.2-0/lib/python/Interface/Verify.py", line 
45, in _verify
DoesNotImplement: An object does not implement interface <Interface 
Products.PluggableAuthService.interfaces.plugins.ICredentialsUpdatePlugin 
at 40cae96c>



======================================================================
ERROR: test_extractCredentials_with_creds 
(PluggableAuthService.plugins.tests.test_HTTPBasicAuthHelper.HTTPBasicAuthHelperTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/home/regebro/Zopes/Z272/Products/PluggableAuthService/plugins/tests/test_HTTPBasicAuthHelper.py", 
line 77, in test_extractCredentials_with_creds
     self.assertEqual( helper.extractCredentials( request )
   File 
"/home/regebro/Zopes/Z272/Products/PluggableAuthService/plugins/HTTPBasicAuthHelper.py", 
line 79, in extractCredentials
     creds[ 'remote_host' ] = request.get('REMOTE_HOST', '')
AttributeError: FauxHTTPRequest instance has no attribute 'get'

======================================================================
ERROR: test_updateCredentials 
(PluggableAuthService.plugins.tests.test_HTTPBasicAuthHelper.HTTPBasicAuthHelperTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/home/regebro/Zopes/Z272/Products/PluggableAuthService/plugins/tests/test_HTTPBasicAuthHelper.py", 
line 97, in test_updateCredentials
     helper.updateCredentials( request, response, new_password='baz' )
AttributeError: updateCredentials

======================================================================
FAIL: test_enumerateGroups_exact_one 
(PluggableAuthService.plugins.tests.test_DyamicGroupsPlugin.DynamicGroupsPlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"/home/regebro/Zopes/Z272/Products/PluggableAuthService/plugins/tests/test_DyamicGroupsPlugin.py", 
line 299, in test_enumerateGroups_exact_one
     self.assertEqual( info[ 'properties_url' ], URL )
   File "/usr/lib/python2.3/unittest.py", line 302, in failUnlessEqual
     raise self.failureException, \
AssertionError: '//noone/manage_propertiesForm' != 
'/enumerating/noone/manage_propertiesForm'

----------------------------------------------------------------------


More information about the Zope-PAS mailing list