[Zodb-checkins] CVS: ZODB3/ZConfig/tests - test_loader.py:1.14.44.3

Jeremy Hylton jeremy at zope.com
Fri Sep 19 17:25:21 EDT 2003


Update of /cvs-repository/ZODB3/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv14963/ZConfig/tests

Modified Files:
      Tag: Zope-2_7-branch
	test_loader.py 
Log Message:
Remove changes made during merge of ZODB3-3_2-branch.


=== ZODB3/ZConfig/tests/test_loader.py 1.14.44.2 => 1.14.44.3 ===
--- ZODB3/ZConfig/tests/test_loader.py:1.14.44.2	Mon Sep 15 14:03:00 2003
+++ ZODB3/ZConfig/tests/test_loader.py	Fri Sep 19 17:24:49 2003
@@ -76,22 +76,30 @@
         schema = loader.loadFile(sio)
         self.assert_(schema.gettype("widget-a") is not None)
 
-    def test_import_from_package_extended(self):
+    def test_import_from_package_with_file(self):
         loader = ZConfig.loader.SchemaLoader()
         sio = StringIO("<schema>"
-                       "  <import package='ZConfig.tests.library.thing'/>"
-                       "  <section name='*' type='thing' attribute='thing'/>"
+                       "  <import package='ZConfig.tests.library.widget'"
+                       "          file='extra.xml' />"
                        "</schema>")
         schema = loader.loadFile(sio)
-        schema.gettype("thing")
-        schema.gettype("thing-a")
-        schema.gettype("thing-b")
-        schema.gettype("thing-ext")
+        self.assert_(schema.gettype("extra-type") is not None)
 
-        # 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_import_from_package_with_missing_file(self):
+        loader = ZConfig.loader.SchemaLoader()
+        sio = StringIO("<schema>"
+                       "  <import package='ZConfig.tests.library.widget'"
+                       "          file='notthere.xml' />"
+                       "</schema>")
+        self.assertRaises(ZConfig.SchemaError, loader.loadFile, sio)
+
+    def test_import_from_package_with_directory_file(self):
+        loader = ZConfig.loader.SchemaLoader()
+        sio = StringIO("<schema>"
+                       "  <import package='ZConfig.tests.library.widget'"
+                       "          file='really/notthere.xml' />"
+                       "</schema>")
+        self.assertRaises(ZConfig.SchemaError, loader.loadFile, sio)
 
     def test_urlsplit_urlunsplit(self):
         # Extracted from Python's test.test_urlparse module:




More information about the Zodb-checkins mailing list