[Zope3-checkins] CVS: Packages/ZConfig/tests - support.py:1.2
Fred L. Drake, Jr.
fred@zope.com
Wed, 19 Feb 2003 16:31:13 -0500
Update of /cvs-repository/Packages/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv14006
Modified Files:
support.py
Log Message:
Move creation of the configuration loader to a separate method.
=== Packages/ZConfig/tests/support.py 1.1 => 1.2 ===
--- Packages/ZConfig/tests/support.py:1.1 Wed Feb 19 10:54:15 2003
+++ Packages/ZConfig/tests/support.py Wed Feb 19 16:31:12 2003
@@ -56,12 +56,17 @@
def load_config(self, schema, conf_url, num_handlers=0):
conf_url = urljoin(CONFIG_BASE, conf_url)
- self.conf, self.handlers = ConfigLoader(schema).loadURL(conf_url)
+ loader = self.create_loader(schema)
+ self.conf, self.handlers = loader.loadURL(conf_url)
self.assertEqual(len(self.handlers), num_handlers)
return self.conf
def load_config_text(self, schema, text, num_handlers=0, url=None):
sio = StringIO.StringIO(text)
- self.conf, self.handlers = ZConfig.loadConfigFile(schema, sio, url)
+ loader = self.create_loader(schema)
+ self.conf, self.handlers = loader.loadFile(sio, url)
self.assertEqual(len(self.handlers), num_handlers)
return self.conf
+
+ def create_loader(self, schema):
+ return ConfigLoader(schema)