[Zope3-checkins] CVS: Zope3/src/zope/configuration/tests - test_xmlconfig.py:1.6

Jim Fulton jim at zope.com
Mon Mar 1 16:22:09 EST 2004


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

Modified Files:
	test_xmlconfig.py 
Log Message:
Added a files attribute to the zcml include directive.  This allows 
multiple files to be included using file-name globs, as in:

<include files="products/*-meta.zcml" />


=== Zope3/src/zope/configuration/tests/test_xmlconfig.py 1.5 => 1.6 ===
--- Zope3/src/zope/configuration/tests/test_xmlconfig.py:1.5	Mon Mar  1 08:25:48 2004
+++ Zope3/src/zope/configuration/tests/test_xmlconfig.py	Mon Mar  1 16:22:08 2004
@@ -270,6 +270,54 @@
     ['tests/samplepackage/foo.zcml.in']
     """
 
+def test_include_by_file_glob():
+    """
+    >>> context = config.ConfigurationMachine()
+    >>> xmlconfig.registerCommonDirectives(context)
+    >>> here = os.path.split(__file__)[0]
+    >>> path = os.path.join(here, "samplepackage/baz*.zcml")
+    >>> xmlconfig.include(context, files=path)
+    >>> context.execute_actions()
+    
+    >>> data = foo.data.pop()
+    >>> data.args
+    (('x', 'foo'), ('y', 3))
+    
+    >>> print clean_info_path(`data.info`)
+    File "tests/samplepackage/baz3.zcml", line 5.2-5.28
+
+    >>> print clean_info_path(str(data.info))
+    File "tests/samplepackage/baz3.zcml", line 5.2-5.28
+        <test:foo x="foo" y="3" />
+    
+    >>> data.package
+    
+    >>> data.basepath[-13:]
+    'samplepackage'
+
+    >>> [clean_path(p) for p in data.includepath]
+    ['tests/samplepackage/baz3.zcml']
+    
+    >>> data = foo.data.pop()
+    >>> data.args
+    (('x', 'foo'), ('y', 2))
+    
+    >>> print clean_info_path(`data.info`)
+    File "tests/samplepackage/baz2.zcml", line 5.2-5.28
+
+    >>> print clean_info_path(str(data.info))
+    File "tests/samplepackage/baz2.zcml", line 5.2-5.28
+        <test:foo x="foo" y="2" />
+
+    >>> data.package
+    
+    >>> data.basepath[-13:]
+    'samplepackage'
+
+    >>> [clean_path(p) for p in data.includepath]
+    ['tests/samplepackage/baz2.zcml']
+    """
+
 def clean_actions(actions):
     return [
       {'discriminator': discriminator,




More information about the Zope3-Checkins mailing list