[Zope3-checkins] CVS: Zope3/src/ZConfig/tests - test_loader.py:1.20
Fred L. Drake, Jr.
fred at zope.com
Fri Oct 3 17:44:00 EDT 2003
Update of /cvs-repository/Zope3/src/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv18775/tests
Modified Files:
test_loader.py
Log Message:
Identity components loaded by URL, not package name. This is needed to
allow a Python package to provide more than one component using different
file names, and allow more than one of them to be loaded into a single
schema.
=== Zope3/src/ZConfig/tests/test_loader.py 1.19 => 1.20 ===
--- Zope3/src/ZConfig/tests/test_loader.py:1.19 Fri Oct 3 13:11:33 2003
+++ Zope3/src/ZConfig/tests/test_loader.py Fri Oct 3 17:43:59 2003
@@ -122,6 +122,17 @@
"</schema>")
self.assertRaises(ZConfig.SchemaError, loader.loadFile, sio)
+ def test_import_two_components_one_package(self):
+ loader = ZConfig.loader.SchemaLoader()
+ sio = StringIO("<schema>"
+ " <import package='ZConfig.tests.library.widget' />"
+ " <import package='ZConfig.tests.library.widget'"
+ " file='extra.xml' />"
+ "</schema>")
+ schema = loader.loadFile(sio)
+ schema.gettype("widget-a")
+ schema.gettype("extra-type")
+
def test_urlsplit_urlunsplit(self):
# Extracted from Python's test.test_urlparse module:
for url, parsed, split in [
More information about the Zope3-Checkins
mailing list