[Zope3-checkins] CVS: Zope3/src/zope/products/modulealias/tests -
__init__.py:1.1.2.1 test_modulealias.py:1.1.2.1
Chris McDonough
chrism at plope.com
Wed Jan 14 02:25:57 EST 2004
Update of /cvs-repository/Zope3/src/zope/products/modulealias/tests
In directory cvs.zope.org:/tmp/cvs-serv7694/tests
Added Files:
Tag: steveachrismcd-securitypolicy-branch
__init__.py test_modulealias.py
Log Message:
Small product to manage module aliases via ZCML. I'm not sure where to put this, so for now I'm making it a product.
=== Added File Zope3/src/zope/products/modulealias/tests/__init__.py ===
# A package
=== Added File Zope3/src/zope/products/modulealias/tests/test_modulealias.py ===
import unittest
import sys
from zope.products.modulealias.metaconfigure import _defineModuleAlias
class Test(unittest.TestCase):
def setUp(self):
self.keys = sys.modules.keys()
def tearDown(self):
keys = sys.modules.keys()
for key in keys:
if key not in self.keys:
del sys.modules[key]
def test_definemodulealias(self):
_defineModuleAlias('unittest_alias', 'unittest')
self.assert_('unittest_alias' in sys.modules.keys())
self.assertEqual(sys.modules['unittest_alias'],sys.modules['unittest'])
def test_suite():
loader=unittest.TestLoader()
return loader.loadTestsFromTestCase(Test)
if __name__=='__main__':
unittest.TextTestRunner().run(test_suite())
More information about the Zope3-Checkins
mailing list