[Checkins] SVN: zope.componentvocabulary/trunk/ when loading this package's ZCML configuration, make sure to configure zope.component first

Thomas Lotze tl at gocept.com
Thu Dec 9 11:43:31 EST 2010


Log message for revision 118773:
  when loading this package's ZCML configuration, make sure to configure zope.component first

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

-=-
Modified: zope.componentvocabulary/trunk/CHANGES.txt
===================================================================
--- zope.componentvocabulary/trunk/CHANGES.txt	2010-12-09 16:32:09 UTC (rev 118772)
+++ zope.componentvocabulary/trunk/CHANGES.txt	2010-12-09 16:43:30 UTC (rev 118773)
@@ -5,7 +5,8 @@
 1.0.2 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- When loading this package's ZCML configuration, make sure to configure
+  ``zope.component`` first since we require part of its configuration.
 
 
 1.0.1 (2010-09-25)

Modified: zope.componentvocabulary/trunk/setup.py
===================================================================
--- zope.componentvocabulary/trunk/setup.py	2010-12-09 16:32:09 UTC (rev 118772)
+++ zope.componentvocabulary/trunk/setup.py	2010-12-09 16:43:30 UTC (rev 118773)
@@ -58,6 +58,7 @@
       extras_require=dict(
           test=[
               'zope.component [test]',
+              'zope.configuration',
               ]),
       include_package_data=True,
       zip_safe=False,

Modified: zope.componentvocabulary/trunk/src/zope/componentvocabulary/configure.zcml
===================================================================
--- zope.componentvocabulary/trunk/src/zope/componentvocabulary/configure.zcml	2010-12-09 16:32:09 UTC (rev 118772)
+++ zope.componentvocabulary/trunk/src/zope/componentvocabulary/configure.zcml	2010-12-09 16:43:30 UTC (rev 118773)
@@ -1,6 +1,7 @@
 <configure xmlns="http://namespaces.zope.org/zope">
 
-  <!-- the 'Interfaces' vocabulary below requires a registred IInterface -->
+  <include package="zope.component" file="configure.zcml" />
+
   <interface
       interface="zope.interface.interfaces.IInterface"
       />

Added: zope.componentvocabulary/trunk/src/zope/componentvocabulary/tests/test_configure.py
===================================================================
--- zope.componentvocabulary/trunk/src/zope/componentvocabulary/tests/test_configure.py	                        (rev 0)
+++ zope.componentvocabulary/trunk/src/zope/componentvocabulary/tests/test_configure.py	2010-12-09 16:43:30 UTC (rev 118773)
@@ -0,0 +1,34 @@
+##############################################################################
+#
+# Copyright (c) 2010 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
+
+
+class ZCMLTest(unittest.TestCase):
+
+    def test_configure_zcml_should_be_loadable(self):
+        try:
+            zope.configuration.xmlconfig.XMLConfig(
+                'configure.zcml', zope.componentvocabulary)()
+        except Exception, e:
+            self.fail(e)
+
+    def test_configure_should_register_n_utilities(self):
+        gsm = zope.component.getGlobalSiteManager()
+        count = len(list(gsm.registeredUtilities()))
+        zope.configuration.xmlconfig.XMLConfig(
+            'configure.zcml', zope.componentvocabulary)()
+        self.assertEqual(count + 11, len(list(gsm.registeredUtilities())))


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



More information about the checkins mailing list