[Checkins] SVN: zope.site/trunk/ include zcml dependencies in configure.zcml, added tests for zcml

Thomas Lotze tl at gocept.com
Tue Feb 15 01:36:34 EST 2011


Log message for revision 120339:
  include zcml dependencies in configure.zcml, added tests for zcml

Changed:
  U   zope.site/trunk/CHANGES.txt
  U   zope.site/trunk/setup.py
  U   zope.site/trunk/src/zope/site/configure.zcml
  A   zope.site/trunk/src/zope/site/tests/test_configure.py

-=-
Modified: zope.site/trunk/CHANGES.txt
===================================================================
--- zope.site/trunk/CHANGES.txt	2011-02-15 06:18:55 UTC (rev 120338)
+++ zope.site/trunk/CHANGES.txt	2011-02-15 06:36:34 UTC (rev 120339)
@@ -5,7 +5,7 @@
 3.9.3 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Include zcml dependencies in configure.zcml, added tests for zcml.
 
 
 3.9.2 (2010-09-25)

Modified: zope.site/trunk/setup.py
===================================================================
--- zope.site/trunk/setup.py	2011-02-15 06:18:55 UTC (rev 120338)
+++ zope.site/trunk/setup.py	2011-02-15 06:36:34 UTC (rev 120339)
@@ -55,7 +55,9 @@
       namespace_packages=['zope'],
       extras_require=dict(
           test=[
+              'zope.component[zcml]',
               'zope.configuration',
+              'zope.security[zcml]',
               'zope.testing',
               ]),
       install_requires=[

Modified: zope.site/trunk/src/zope/site/configure.zcml
===================================================================
--- zope.site/trunk/src/zope/site/configure.zcml	2011-02-15 06:18:55 UTC (rev 120338)
+++ zope.site/trunk/src/zope/site/configure.zcml	2011-02-15 06:36:34 UTC (rev 120339)
@@ -1,6 +1,10 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            i18n_domain="zope">
 
+  <include file="meta.zcml" package="zope.component" />
+  <include file="meta.zcml" package="zope.security" />
+  <include file="permissions.zcml" package="zope.security" />
+
   <interface interface="zope.interface.Interface" />
 
   <!-- Site and Site Manager Framework -->

Added: zope.site/trunk/src/zope/site/tests/test_configure.py
===================================================================
--- zope.site/trunk/src/zope/site/tests/test_configure.py	                        (rev 0)
+++ zope.site/trunk/src/zope/site/tests/test_configure.py	2011-02-15 06:36:34 UTC (rev 120339)
@@ -0,0 +1,42 @@
+##############################################################################
+#
+# Copyright (c) 2011 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (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.
+#
+##############################################################################
+
+import unittest
+import zope.component
+import zope.configuration.xmlconfig
+import zope.site
+
+
+class ZCMLTest(unittest.TestCase):
+
+    def test_configure_zcml_should_be_loadable(self):
+        try:
+            zope.configuration.xmlconfig.XMLConfig(
+                'configure.zcml', zope.site)()
+        except Exception, e:
+            self.fail(e)
+
+    def test_configure_should_register_n_components(self):
+        gsm = zope.component.getGlobalSiteManager()
+        u_count = len(list(gsm.registeredUtilities()))
+        a_count = len(list(gsm.registeredAdapters()))
+        s_count = len(list(gsm.registeredSubscriptionAdapters()))
+        h_count = len(list(gsm.registeredHandlers()))
+        zope.configuration.xmlconfig.XMLConfig(
+            'configure.zcml', zope.site)()
+        self.assertEqual(u_count + 21, len(list(gsm.registeredUtilities())))
+        self.assertEqual(a_count + 3, len(list(gsm.registeredAdapters())))
+        self.assertEqual(
+            s_count, len(list(gsm.registeredSubscriptionAdapters())))
+        self.assertEqual(h_count + 2, len(list(gsm.registeredHandlers())))


Property changes on: zope.site/trunk/src/zope/site/tests/test_configure.py
___________________________________________________________________
Added: svn:keywords
   + Id Rev Date
Added: svn:eol-style
   + native



More information about the checkins mailing list