[Zope-Checkins] CVS: ZODB3/ZEO/tests - forker.py:1.21.2.3

Barry Warsaw barry@zope.com
Fri, 25 Jul 2003 15:38:02 -0400


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv22458/ZEO/tests

Modified Files:
      Tag: ZODB3-3_1-branch
	forker.py 
Log Message:
load_storage(): Make this a bit more general to support running
Berkeley storage tests under ZEO.


=== ZODB3/ZEO/tests/forker.py 1.21.2.2 => 1.21.2.3 ===
--- ZODB3/ZEO/tests/forker.py:1.21.2.2	Mon Feb  3 14:07:19 2003
+++ ZODB3/ZEO/tests/forker.py	Fri Jul 25 15:37:57 2003
@@ -127,9 +127,11 @@
             return pid, ZEOClientExit(wr)
 
     def load_storage(name, args):
-        package = __import__("ZODB." + name)
-        mod = getattr(package, name)
-        klass = getattr(mod, name)
+        i = name.rfind('.')
+        pkgname, classname = name[:i], name[i+1:]
+        __import__(pkgname)
+        mod = sys.modules[pkgname]
+        klass = getattr(mod, classname)
         return klass(*args)
 
     def run_server(addr, rd, wr, storage_name, args, ro_svr,