[Zodb-checkins] CVS: ZODB3/ZEO/tests - testZEO.py:1.37 winserver.py:1.7

Guido van Rossum guido@python.org
Sun, 15 Sep 2002 00:31:43 -0400


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

Modified Files:
	testZEO.py winserver.py 
Log Message:
Fix argument passing to the storage factory in winserver.
This code used to assume that all arguments were strings.
It was always wrong (create was passed as '0' or '1' rather
than as 0 or 1) but this was somehow masked.  When I added
readonly, things broke.  The solution is that winserver.py
ha a convention that an argument starting with '=' is
evaluated as an expression, and _startserver in testZEO's
WindowsConnectionText uses this for the create and readonly
args.


=== ZODB3/ZEO/tests/testZEO.py 1.36 => 1.37 ===
--- ZODB3/ZEO/tests/testZEO.py:1.36	Fri Sep 13 17:13:44 2002
+++ ZODB3/ZEO/tests/testZEO.py	Sun Sep 15 00:31:42 2002
@@ -508,8 +508,9 @@
     def _startServer(self, create=1, index=0, read_only=0):
         path = "%s.%d" % (self.file, index)
         addr = self.addr[index]
+        args = (path, '='+str(create), '='+str(read_only))
         _addr, test_addr, test_pid = forker.start_zeo_server(
-            'FileStorage', (path, str(create), read_only), addr)
+            'FileStorage', args, addr)
         self._pids.append(test_pid)
         self._servers.append(test_addr)
 


=== ZODB3/ZEO/tests/winserver.py 1.6 => 1.7 ===
--- ZODB3/ZEO/tests/winserver.py:1.6	Thu Sep 12 15:02:33 2002
+++ ZODB3/ZEO/tests/winserver.py	Sun Sep 15 00:31:42 2002
@@ -50,8 +50,13 @@
     mod = getattr(package, name)
     return getattr(mod, name)
 
-def main(port, storage_name, args):
+def main(port, storage_name, rawargs):
     klass = load_storage_class(storage_name)
+    args = []
+    for arg in rawargs:
+        if arg.startswith('='):
+            arg = eval(arg[1:], {'__builtins__': {}})
+        args.append(arg)
     storage = klass(*args)
     zeo_port = int(port)
     test_port = zeo_port + 1