[Zope3-checkins] CVS: Zope3/src/zope/configuration/tests - backwardkwextra.zcml:1.1 directives.py:1.7 test_backward.py:1.3

Jim Fulton jim@zope.com
Wed, 30 Jul 2003 14:35:17 -0400


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

Modified Files:
	directives.py test_backward.py 
Added Files:
	backwardkwextra.zcml 
Log Message:
Added support for including an attribute named "*" when using the old
meta-configuration directives to allow arbitrary parameters.

(For new-style directives, this is signalled by setting the
"keyword_arguments" tagged value to true on the directive schema.)


=== Added File Zope3/src/zope/configuration/tests/backwardkwextra.zcml ===
<configure 
  xmlns="http://namespaces.zope.org/zope"
  xmlns:test="http://namespaces.zope.org/test"
  package="zope.configuration.tests.directives"
  >

  <directives namespace="http://namespaces.zope.org/test">
  
     <directive name="k" attributes="for * class x"
                handler=".kkw" />
          
  </directives>

  <test:k  for="f"  class="c"  x="x" a="a" b="b" />

</configure>



=== Zope3/src/zope/configuration/tests/directives.py 1.6 => 1.7 ===
--- Zope3/src/zope/configuration/tests/directives.py:1.6	Mon Jul 28 18:22:47 2003
+++ Zope3/src/zope/configuration/tests/directives.py	Wed Jul 30 14:35:12 2003
@@ -86,3 +86,6 @@
     
 def k(context, for_, class_, x):
     context.action(('k', for_), f, (for_, class_, x))
+
+def kkw(context, for_, class_, x, **kw):
+    context.action(('k', for_), f, (for_, class_, x, kw))


=== Zope3/src/zope/configuration/tests/test_backward.py 1.2 => 1.3 ===
--- Zope3/src/zope/configuration/tests/test_backward.py:1.2	Wed Jul 30 10:35:13 2003
+++ Zope3/src/zope/configuration/tests/test_backward.py	Wed Jul 30 14:35:12 2003
@@ -98,6 +98,21 @@
     
     """
 
+def test_directive_and_integration_w_extra_arguments():
+    r"""
+
+    >>> from zope.configuration import tests
+    >>> context = xmlconfig.file("backwardkwextra.zcml", tests, execute=False)
+    >>> for action in context.actions:
+    ...   print action[:2]
+    ...   print action[2]
+    ...   print clean_text_w_paths(unicode(action[5]))
+    (('k', u'f'), f)
+    (u'f', u'c', u'x', {'a': u'a', 'b': u'b'})
+    File "tests/backwardkwextra.zcml", line 14.2-14.51
+        <test:k  for="f"  class="c"  x="x" a="a" b="b" />
+    """
+
 def test_suite():
     return unittest.TestSuite((
         DocTestSuite('zope.configuration.backward'),