[Zope-CVS] CVS: Products/PluggableAuthService/plugins/tests - helpers.py:1.1

Zachery Bir zbir at urbanape.com
Mon Aug 30 11:23:26 EDT 2004


Update of /cvs-repository/Products/PluggableAuthService/plugins/tests
In directory cvs.zope.org:/tmp/cvs-serv17892/plugins/tests

Added Files:
	helpers.py 
Log Message:
Some new files/modules:

  - CHANGES.txt - changelog

  - Extensions/upgrade.py - an example External Method for replacing
    the root acl_users folder with a PluggableAuthService instance.

  - plugins/tests/helpers.py - some commonly used dummy classes


=== Added File Products/PluggableAuthService/plugins/tests/helpers.py ===
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights
# Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this
# distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from Products.PluggableAuthService.tests.test_PluggableAuthService \
    import FauxContainer

class FauxPAS( FauxContainer ):

    def __init__( self ):
        self._id = 'acl_users'

    def searchPrincipals( self, **kw ):
        id = kw.get( 'id' )
        return [ { 'id': id } ]

class FauxSmartPAS( FauxContainer ):

    def __init__( self ):
        self._id = 'acl_users'
        self.user_ids = {}

    def searchPrincipals( self, **kw ):
        id = kw.get( 'id' )
        prin = self.user_ids.get(id, None)
        return (prin and [ { 'id': id } ]) or []

class DummyUser:

    def __init__( self, id ):
        self._id = id

    def getId( self ):
        return self._id




More information about the Zope-CVS mailing list