[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture/tests - testProvideFactory.py:1.1.2.1 testFactory.py:NONE
Steve Alexander
steve@cat-box.net
Thu, 28 Mar 2002 03:14:45 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture/tests
In directory cvs.zope.org:/tmp/cvs-serv25670
Added Files:
Tag: Zope-3x-branch
testProvideFactory.py
Removed Files:
Tag: Zope-3x-branch
testFactory.py
Log Message:
renamed testFactory.py to testProvideFactory.py to avoid a naming
clash on Win32
=== Added File Zope3/lib/python/Zope/ComponentArchitecture/tests/testProvideFactory.py ===
"""Test the provideFactory function."""
import unittest
from Zope.ComponentArchitecture.IFactory import IFactory
from Zope.ComponentArchitecture import provideFactory, createObject
from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
class MyThing:
pass
class MyFactory:
__implements__ = IFactory
def __call__(self):
return MyThing()
class ProvideFactoryTestCase(CleanUp, unittest.TestCase):
def test_provide_factory(self):
provideFactory("Some.Object", MyFactory())
thing = createObject(None,"Some.Object")
self.assert_(isinstance(thing, MyThing))
def test_suite():
return unittest.makeSuite(ProvideFactoryTestCase)
=== Removed File Zope3/lib/python/Zope/ComponentArchitecture/tests/testFactory.py ===