[Zodb-checkins] CVS: Packages/ZConfig/tests - test_loader.py:1.6
Fred L. Drake, Jr.
fred@zope.com
Tue, 7 Jan 2003 15:01:06 -0500
Update of /cvs-repository/Packages/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv28720
Modified Files:
test_loader.py
Log Message:
Re-enable and elaborate the schema component extension test.
=== Packages/ZConfig/tests/test_loader.py 1.5 => 1.6 ===
--- Packages/ZConfig/tests/test_loader.py:1.5 Tue Jan 7 01:27:11 2003
+++ Packages/ZConfig/tests/test_loader.py Tue Jan 7 15:01:00 2003
@@ -87,16 +87,22 @@
schema = loader.loadFile(sio)
self.assert_(schema.gettype("widget-a") is not None)
- def xxx_test_import_from_package_extended(self):
+ def test_import_from_package_extended(self):
loader = ZConfig.loader.SchemaLoader(library=LIBRARY_DIR)
sio = StringIO("<schema>"
" <import package='thing'/>"
+ " <section name='*' type='thing' attribute='thing'/>"
"</schema>")
schema = loader.loadFile(sio)
- self.assert_(schema.gettype("thing-a") is not None)
- self.assert_(schema.gettype("thing-b") is not None)
- self.assert_(schema.gettype("thing-ext") is not None)
- self.assert_(schema.gettype("thing"))
+ schema.gettype("thing")
+ schema.gettype("thing-a")
+ schema.gettype("thing-b")
+ schema.gettype("thing-ext")
+
+ # Make sure the extension is wired in properly:
+ sio = StringIO("<thing-ext thing/>")
+ conf, handlers = ZConfig.loadConfigFile(schema, sio)
+ self.assertEqual(conf.thing.thing_ext_key, "thing-ext-default")
def test_suite():