[Zope-Checkins] CVS: Packages/ZConfig/tests - test_config.py:1.4
Fred L. Drake, Jr.
fred@zope.com
Mon, 13 Jan 2003 12:30:54 -0500
Update of /cvs-repository/Packages/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv5579
Modified Files:
test_config.py
Log Message:
Avoid using the old loadURL() and loadFile() functions from the
ZConfig package; they are no longer documented API.
=== Packages/ZConfig/tests/test_config.py 1.3 => 1.4 ===
--- Packages/ZConfig/tests/test_config.py:1.3 Thu Jan 9 11:05:37 2003
+++ Packages/ZConfig/tests/test_config.py Mon Jan 13 12:30:51 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")