Commit 8e1d0ce4 authored by Jim Fulton's avatar Jim Fulton

Updated for new underware and new higher minimum protocol

parent eda1bb08
......@@ -17,15 +17,15 @@ Let's start a Z308 server
... '''
>>> addr, admin = start_server(
... storage_conf, dict(invalidation_queue_size=5), protocol=b'Z308')
... storage_conf, dict(invalidation_queue_size=5), protocol=b'Z309')
A current client should be able to connect to a old server:
>>> import ZEO, ZODB.blob, transaction
>>> db = ZEO.DB(addr, client='client', blob_dir='blobs')
>>> wait_connected(db.storage)
>>> db.storage._connection.peer_protocol_version
b'Z308'
>>> db.storage.protocol_version
b'Z309'
>>> conn = db.open()
>>> conn.root().x = 0
......@@ -85,13 +85,6 @@ A current client should be able to connect to a old server:
... f.read()
b'blob data 2'
Note that when taking to a 3.8 server, iteration won't work:
>>> db.storage.iterator()
Traceback (most recent call last):
...
NotImplementedError
>>> db2.close()
>>> db.close()
>>> stop_server(admin)
......@@ -107,13 +100,13 @@ And the other way around:
Note that we'll have to pull some hijinks:
>>> import ZEO.zrpc.connection
>>> old_current_protocol = ZEO.zrpc.connection.Connection.current_protocol
>>> ZEO.zrpc.connection.Connection.current_protocol = b'Z308'
>>> import ZEO.asyncio.client
>>> old_protocols = ZEO.asyncio.client.Protocol.protocols
>>> ZEO.asyncio.client.Protocol.protocols = [b'Z309']
>>> db = ZEO.DB(addr, client='client', blob_dir='blobs')
>>> db.storage._connection.peer_protocol_version
b'Z308'
>>> db.storage.protocol_version
b'Z309'
>>> wait_connected(db.storage)
>>> conn = db.open()
>>> conn.root().x = 0
......@@ -174,23 +167,9 @@ Note that we'll have to pull some hijinks:
... f.read()
b'blob data 2'
Make some old protocol calls:
>>> db.storage._server.rpc.call('getSerial', conn.root()._p_oid
... ) == conn.root()._p_serial
True
>>> p, s, v, x, y = db.storage._server.rpc.call('zeoLoad',
... conn.root()._p_oid)
>>> (v, x, y) == ('', None, None)
True
>>> db.storage.load(conn.root()._p_oid) == (p, s)
True
>>> db2.close()
>>> db.close()
Undo the hijinks:
>>> ZEO.zrpc.connection.Connection.current_protocol = old_current_protocol
>>> ZEO.asyncio.client.Protocol.protocols = old_protocols
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment