[Zope3-checkins] CVS: Zope3/src/zope/modulealias/tests - test_modulealias.py:1.1.2.3

Chris McDonough chrism at plope.com
Wed Jan 14 12:01:10 EST 2004


Update of /cvs-repository/Zope3/src/zope/modulealias/tests
In directory cvs.zope.org:/tmp/cvs-serv10884/tests

Modified Files:
      Tag: steveachrismcd-securitypolicy-branch
	test_modulealias.py 
Log Message:
Test for attempts to alias things to objects other than modules.


=== Zope3/src/zope/modulealias/tests/test_modulealias.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/modulealias/tests/test_modulealias.py:1.1.2.2	Wed Jan 14 11:46:11 2004
+++ Zope3/src/zope/modulealias/tests/test_modulealias.py	Wed Jan 14 12:01:09 2004
@@ -64,6 +64,16 @@
         self.assert_(m1 in sys.modules)
         self.assert_(sys.modules[m1] is sys.modules[m2])
 
+    def test_nonmodule_alias(self):
+        from zope.modulealias.metaconfigure import ModuleAliasException
+        context = ConfigurationContext()
+        from zope.modulealias.metaconfigure import alias_module
+        m1 = 'zope.modulealias.tests.test_modulealias.Test'
+        m2 = 'zope.modulealias.tests.test_modulealias.Test2'
+        self.assertRaises(ModuleAliasException,
+                          alias_module, module=m1, alias=m2, context=context,
+                          )
+                          
     def test_zcml(self):
         context = xmlconfig.string(stuff)
         self.assert_('unittest_alias' in sys.modules.keys())




More information about the Zope3-Checkins mailing list