[Zodb-checkins] CVS: Packages/ZConfig/tests - testConfig.py:1.16.10.2
Fred L. Drake, Jr.
fred@zope.com
Tue, 10 Dec 2002 14:50:05 -0500
Update of /cvs-repository/Packages/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv1122/tests
Modified Files:
Tag: zconfig-schema-devel-branch
testConfig.py
Log Message:
load() and loadfile() are now called loadURL() and loadFile(), to be more
consistent with the other names used.
More refactoring of resource handling; the loadURL() and loadFile() methods
are each only implemented once! loadResource() is the specialized method.
=== Packages/ZConfig/tests/testConfig.py 1.16.10.1 => 1.16.10.2 ===
--- Packages/ZConfig/tests/testConfig.py:1.16.10.1 Tue Dec 10 10:57:20 2002
+++ Packages/ZConfig/tests/testConfig.py Tue Dec 10 14:50:03 2002
@@ -39,9 +39,9 @@
def load(self, relurl, context=None):
url = urlparse.urljoin(CONFIG_BASE, relurl)
if context is None:
- conf = ZConfig.load(url)
+ conf = ZConfig.loadURL(url)
else:
- conf = context.load(url)
+ conf = context.loadURL(url)
self.assertEqual(conf.url, url)
self.assert_(conf.name is None)
self.assert_(conf.type is None)
@@ -50,7 +50,7 @@
def loadtext(self, text):
sio = StringIO.StringIO(text)
- return ZConfig.loadfile(sio)
+ return ZConfig.loadFile(sio)
def check_simple_gets(self, conf):
self.assertEqual(conf.get('empty'), '')
@@ -193,7 +193,8 @@
def test_no_delegation(self):
url = urlparse.urljoin(CONFIG_BASE, "simplesections.conf")
context = NoDelegationContext()
- self.assertRaises(ZConfig.ConfigurationTypeError, context.load, url)
+ self.assertRaises(ZConfig.ConfigurationTypeError,
+ context.loadURL, url)
def test_include(self):
conf = self.load("include.conf")
@@ -247,7 +248,7 @@
"<section>\n"
" name value2\n"
"</section>\n")
- cf = ZConfig.loadfile(sio)
+ cf = ZConfig.loadFile(sio)
self.assertEqual(cf.get("Name"), "value")
self.assertEqual(cf.getSection("Section").get("Name"), "value2")
@@ -260,7 +261,7 @@
def check_load_from_path(self, path):
context = Context()
- context.load(path)
+ context.loadURL(path)
class NoDelegationContext(Context):