[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Service/tests - testServiceManagerAdder.py:1.1.2.1
Tres Seaver
tseaver@zope.com
Sat, 9 Feb 2002 09:40:12 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Service/tests
In directory cvs.zope.org:/tmp/cvs-serv21198/App/Service/tests
Added Files:
Tag: Zope-3x-branch
testServiceManagerAdder.py
Log Message:
- Add adder for ServiceManagers, including refactoring FolderAdder
to indirect lookup of addables through overridable method.
=== Added File Zope3/lib/python/Zope/App/Service/tests/testServiceManagerAdder.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.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
#
##############################################################################
"""
Revision information:
$Id: testServiceManagerAdder.py,v 1.1.2.1 2002/02/09 14:40:12 tseaver Exp $
"""
import unittest, sys
class DummyFolder:
pass
class Test(unittest.TestCase):
def setUp( self ):
self._zapServiceImplementations()
def tearDown( self ):
self._zapServiceImplementations()
def _zapServiceImplementations( self ):
from Zope.App.ZMI.Addable import _clear
_clear()
def _makeOne( self ):
from Zope.App.Service.ServiceManagerAdder import ServiceManagerAdder
return ServiceManagerAdder( DummyFolder() )
def test_import( self ):
self._makeOne()
def _test_listAddables( self ): # broken until registry available
adder = self._makeOne()
dict_list = adder.listAddableInfo()
def test_suite():
loader=unittest.TestLoader()
return loader.loadTestsFromTestCase(Test)
if __name__=='__main__':
unittest.TextTestRunner().run(test_suite())