[Checkins] SVN: zope.copypastemove/trunk/ include zcml dependencies in configure.zcml, require the necessary packages via a zcml extra, added tests for zcml

Thomas Lotze tl at gocept.com
Tue Feb 15 10:55:24 EST 2011


Log message for revision 120347:
  include zcml dependencies in configure.zcml, require the necessary packages via a zcml extra, added tests for zcml

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

-=-
Modified: zope.copypastemove/trunk/CHANGES.txt
===================================================================
--- zope.copypastemove/trunk/CHANGES.txt	2011-02-15 15:46:28 UTC (rev 120346)
+++ zope.copypastemove/trunk/CHANGES.txt	2011-02-15 15:55:24 UTC (rev 120347)
@@ -2,10 +2,11 @@
 CHANGES
 =======
 
-3.8.1 (unreleased)
+3.9.0 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Include zcml dependencies in configure.zcml, require the necessary packages
+  via a zcml extra, added tests for zcml.
 
 
 3.8.0 (2010-09-14)

Modified: zope.copypastemove/trunk/buildout.cfg
===================================================================
--- zope.copypastemove/trunk/buildout.cfg	2011-02-15 15:46:28 UTC (rev 120346)
+++ zope.copypastemove/trunk/buildout.cfg	2011-02-15 15:55:24 UTC (rev 120347)
@@ -4,4 +4,4 @@
 
 [test]
 recipe = zc.recipe.testrunner
-eggs = zope.copypastemove [test]
+eggs = zope.copypastemove [test,zcml]

Modified: zope.copypastemove/trunk/setup.py
===================================================================
--- zope.copypastemove/trunk/setup.py	2011-02-15 15:46:28 UTC (rev 120346)
+++ zope.copypastemove/trunk/setup.py	2011-02-15 15:55:24 UTC (rev 120347)
@@ -17,7 +17,7 @@
 # Zope Toolkit policies as described by this documentation.
 ##############################################################################
 
-version = '3.8.1dev'
+version = '3.9.0dev'
 
 from setuptools import setup, find_packages
 
@@ -48,7 +48,12 @@
                 'zope.testing',
                 'zope.traversing',
                 'zope.dublincore >= 3.8',
-                ]),
+                ],
+          zcml=[
+            'zope.component[zcml]',
+            'zope.configure',
+            'zope.security[zcml]',
+            ]),
       install_requires=['setuptools',
                         'zope.annotation',
                         'zope.component',

Modified: zope.copypastemove/trunk/src/zope/copypastemove/configure.zcml
===================================================================
--- zope.copypastemove/trunk/src/zope/copypastemove/configure.zcml	2011-02-15 15:46:28 UTC (rev 120346)
+++ zope.copypastemove/trunk/src/zope/copypastemove/configure.zcml	2011-02-15 15:55:24 UTC (rev 120347)
@@ -4,6 +4,10 @@
     i18n_domain="zope"
     >
 
+  <include file="meta.zcml" package="zope.component" />
+  <include file="meta.zcml" package="zope.security" />
+  <include file="permissions.zcml" package="zope.security" />
+
   <adapter
       factory=".ObjectMover"
       permission="zope.ManageContent"

Added: zope.copypastemove/trunk/src/zope/copypastemove/tests/test_configure.py
===================================================================
--- zope.copypastemove/trunk/src/zope/copypastemove/tests/test_configure.py	                        (rev 0)
+++ zope.copypastemove/trunk/src/zope/copypastemove/tests/test_configure.py	2011-02-15 15:55:24 UTC (rev 120347)
@@ -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.copypastemove
+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.copypastemove)()
+        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.copypastemove)()
+        self.assertEqual(u_count + 17, len(list(gsm.registeredUtilities())))
+        self.assertEqual(a_count + 5, len(list(gsm.registeredAdapters())))
+        self.assertEqual(
+            s_count, len(list(gsm.registeredSubscriptionAdapters())))
+        self.assertEqual(h_count + 1, len(list(gsm.registeredHandlers())))


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



More information about the checkins mailing list