[Zodb-checkins] CVS: Zope/lib/python/ZConfig/tests - test_config.py:1.3.2.1 test_loader.py:1.9.2.1 test_schema.py:1.7.2.1

Chris McDonough chrism@zope.com
Mon, 13 Jan 2003 20:17:36 -0500


Update of /cvs-repository/Zope/lib/python/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv6546/tests

Modified Files:
      Tag: chrism-install-branch
	test_config.py test_loader.py test_schema.py 
Log Message:
Merge ZConfig from HEAD.


=== Zope/lib/python/ZConfig/tests/test_config.py 1.3 => 1.3.2.1 ===
--- Zope/lib/python/ZConfig/tests/test_config.py:1.3	Thu Jan  9 11:05:37 2003
+++ Zope/lib/python/ZConfig/tests/test_config.py	Mon Jan 13 20:17:31 2003
@@ -39,9 +39,8 @@
     def load(self, relurl, context=None):
         url = urljoin(CONFIG_BASE, relurl)
         if context is None:
-            conf = ZConfig.loadURL(url)
-        else:
-            conf = context.loadURL(url)
+            context = Context()
+        conf = context.loadURL(url)
         self.assertEqual(conf.url, url)
         self.assert_(conf.name is None)
         self.assert_(conf.type is None)
@@ -50,7 +49,7 @@
 
     def loadtext(self, text):
         sio = StringIO.StringIO(text)
-        return ZConfig.loadFile(sio)
+        return Context().loadFile(sio)
 
     def check_simple_gets(self, conf):
         self.assertEqual(conf.get('empty'), '')
@@ -254,7 +253,7 @@
                                 "<section>\n"
                                 "  name value2\n"
                                 "</section>\n")
-        cf = ZConfig.loadFile(sio)
+        cf = Context().loadFile(sio)
         self.assertEqual(cf.get("Name"), "value")
         self.assertEqual(cf.getSection("Section").get("Name"), "value2")
 


=== Zope/lib/python/ZConfig/tests/test_loader.py 1.9 => 1.9.2.1 ===
--- Zope/lib/python/ZConfig/tests/test_loader.py:1.9	Thu Jan  9 17:29:36 2003
+++ Zope/lib/python/ZConfig/tests/test_loader.py	Mon Jan 13 20:17:31 2003
@@ -44,18 +44,6 @@
         schema2 = loader.loadURL(url)
         self.assert_(schema1 is schema2)
 
-    def test_schema_components(self):
-        loader = ZConfig.loader.SchemaLoader()
-        url = ZConfig.url.urljoin(CONFIG_BASE, "library.xml")
-        schema = loader.loadURL(url)
-        type_a = loader.loadURL(url + "#type-a")
-        type_b = loader.loadURL(url + "#type-b")
-        self.assertEqual(type_a.name, "type-a")
-        self.assertEqual(type_b.name, "type-b")
-        # make sure we're using the cached schema for the types
-        self.assert_(type_a is schema.gettype("type-a"))
-        self.assert_(type_b is schema.gettype("type-b"))
-
     def test_simple_import_with_cache(self):
         loader = ZConfig.loader.SchemaLoader()
         url1 = ZConfig.url.urljoin(CONFIG_BASE, "library.xml")


=== Zope/lib/python/ZConfig/tests/test_schema.py 1.7 => 1.7.2.1 ===
--- Zope/lib/python/ZConfig/tests/test_schema.py:1.7	Thu Jan  9 00:42:31 2003
+++ Zope/lib/python/ZConfig/tests/test_schema.py	Mon Jan 13 20:17:31 2003
@@ -420,14 +420,14 @@
         self.assertEqual(schema.getrequiredtypes(), [])
 
         schema = self.load_schema_text(
-            "<schema type='top'>"
+            "<schema>"
             "  <sectiontype name='used'/>"
             "  <sectiontype name='unused'/>"
             "  <section type='used' name='a'/>"
             "</schema>")
         L = schema.getrequiredtypes()
         L.sort()
-        self.assertEqual(L, ["top", "used"])
+        self.assertEqual(L, ["used"])
 
     def test_getunusedtypes(self):
         schema = self.load_schema("library.xml")