[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests - TestingServiceManager.py:1.1 TestServiceManager.py:NONE

Guido van Rossum guido@python.org
Wed, 13 Nov 2002 15:34:04 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests
In directory cvs.zope.org:/tmp/cvs-serv2318/lib/python/Zope/App/OFS/Services/ServiceManager/tests

Added Files:
	TestingServiceManager.py 
Removed Files:
	TestServiceManager.py 
Log Message:
Since we want to support Windows, you can't have two files in the same
directory whose names only differ in case.  So the brand new class and
module TestServiceManager are hereby officially renamed to
TestingServiceManager.  (Jim's suggestion.)



=== Added File Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests/TestingServiceManager.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
# 
##############################################################################
"""
$Id: TestingServiceManager.py,v 1.1 2002/11/13 20:34:03 gvanrossum Exp $
"""

__metaclass__ = type

from Zope.ComponentArchitecture.IServiceService import IServiceService
from Zope.App.ComponentArchitecture.NextService \
     import getNextService, getNextServiceManager
from Zope.Proxy.ContextWrapper import ContextWrapper

class TestingServiceManager:
    """Simple placeful service manager used for writing tests
    """
    __implements__ =  IServiceService


    def getServiceDefinitions(self):
        "See Zope.ComponentArchitecture.IServiceService.IServiceService"
        return getNextServiceManager.getServiceDefinitions()

    def getInterfaceFor(self, name):
        "See Zope.ComponentArchitecture.IServiceService.IServiceService"
        return getNextServiceManager.getServiceDefinitions()

    def getService(self, name):
        "See Zope.ComponentArchitecture.IServiceService.IServiceService"
        if hasattr(self, name):
            return ContextWrapper(getattr(self, name), self, name=name)
        return getNextServiceManager.getService(name)

    def queryService(self, name, default=None):
        "See Zope.ComponentArchitecture.IServiceService.IServiceService"
        if hasattr(self, name):
            return ContextWrapper(getattr(self, name), self, name=name)
        return getNextServiceManager.queryService(name, default)

__doc__ = TestingServiceManager.__doc__ + __doc__


=== Removed File Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests/TestServiceManager.py ===