[Zodb-checkins] CVS: Packages/ZConfig/tests - test_loader.py:1.4 test_zopeschema.py:1.3

Fred L. Drake, Jr. fred@zope.com
Fri, 3 Jan 2003 17:39:04 -0500


Update of /cvs-repository/Packages/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv27759

Modified Files:
	test_loader.py test_zopeschema.py 
Log Message:
Avoid the zconfig: URL scheme; it is going away.

=== Packages/ZConfig/tests/test_loader.py 1.3 => 1.4 ===
--- Packages/ZConfig/tests/test_loader.py:1.3	Fri Jan  3 17:18:20 2003
+++ Packages/ZConfig/tests/test_loader.py	Fri Jan  3 17:38:30 2003
@@ -14,14 +14,13 @@
 """Tests of ZConfig.loader classes and helper functions."""
 
 import unittest
-import urlparse
 
 from StringIO import StringIO
 
 import ZConfig
 import ZConfig.loader
 
-from ZConfig import url
+from ZConfig.url import urljoin
 
 from ZConfig.tests.test_config import CONFIG_BASE
 
@@ -30,14 +29,14 @@
 
     def test_schema_caching(self):
         loader = ZConfig.loader.SchemaLoader()
-        url = urlparse.urljoin(CONFIG_BASE, "simple.xml")
+        url = urljoin(CONFIG_BASE, "simple.xml")
         schema1 = loader.loadURL(url)
         schema2 = loader.loadURL(url)
         self.assert_(schema1 is schema2)
 
     def test_schema_components(self):
         loader = ZConfig.loader.SchemaLoader()
-        url = urlparse.urljoin(CONFIG_BASE, "library.xml")
+        url = urljoin(CONFIG_BASE, "library.xml")
         schema = loader.loadURL(url)
         type_a = loader.loadURL(url + "#type-a")
         type_b = loader.loadURL(url + "#type-b")
@@ -49,13 +48,13 @@
 
     def test_simple_import_with_cache(self):
         loader = ZConfig.loader.SchemaLoader()
-        url1 = urlparse.urljoin(CONFIG_BASE, "library.xml")
+        url1 = urljoin(CONFIG_BASE, "library.xml")
         schema1 = loader.loadURL(url1)
         sio = StringIO("<schema>"
                        "  <import src='library.xml'/>"
                        "  <section type='type-a' name='section'/>"
                        "</schema>")
-        url2 = urlparse.urljoin(CONFIG_BASE, "stringio")
+        url2 = urljoin(CONFIG_BASE, "stringio")
         schema2 = loader.loadFile(sio, url2)
         self.assert_(schema1.gettype("type-a") is schema2.gettype("type-a"))
 


=== Packages/ZConfig/tests/test_zopeschema.py 1.2 => 1.3 ===
--- Packages/ZConfig/tests/test_zopeschema.py:1.2	Fri Jan  3 16:05:56 2003
+++ Packages/ZConfig/tests/test_zopeschema.py	Fri Jan  3 17:38:30 2003
@@ -119,12 +119,10 @@
     # tests
 
     def test_defaultbug(self):
-        schema = self.load_schema('zconfig:zope.xml')
-        conf = self.load_config(schema, 'empty.conf')
+        schema, conf = self.load_both('zope.xml', 'empty.conf')
 
     def test_load_populated(self):
-        schema = self.load_schema('zconfig:zope.xml')
-        conf = self.load_config(schema, 'zope-allpopulated.conf')
+        schema, conf = self.load_both('zope.xml', 'zope-allpopulated.conf')
         self.assertEqual(conf.zope_home, '.')
         self.assertEqual(conf.instance_home, '.')
         self.assertEqual(conf.software_home, '.')