Commit e6b136a4 authored by Jim Fulton's avatar Jim Fulton Committed by GitHub

Merge pull request #26 from zopefoundation/zodb5

Changed tests to not depend on ZODB underware
parents 2952501b 11b30913
...@@ -174,8 +174,9 @@ Start a server: ...@@ -174,8 +174,9 @@ Start a server:
Open a client storage to it and commit a some transactions: Open a client storage to it and commit a some transactions:
>>> import ZEO, transaction >>> import ZEO, ZODB, transaction
>>> db = ZEO.DB(addr) >>> client = ZEO.client(addr)
>>> db = ZODB.DB(client)
>>> conn = db.open() >>> conn = db.open()
>>> for i in range(10): >>> for i in range(10):
... conn.root().i = i ... conn.root().i = i
...@@ -183,19 +184,19 @@ Open a client storage to it and commit a some transactions: ...@@ -183,19 +184,19 @@ Open a client storage to it and commit a some transactions:
Create an iterator: Create an iterator:
>>> it = conn._storage.iterator() >>> it = client.iterator()
>>> tid1 = it.next().tid >>> tid1 = it.next().tid
Restart the storage: Restart the storage:
>>> stop_server(adminaddr) >>> stop_server(adminaddr)
>>> wait_disconnected(conn._storage) >>> wait_disconnected(client)
>>> _ = start_server('<filestorage>\npath fs\n</filestorage>', addr=addr) >>> _ = start_server('<filestorage>\npath fs\n</filestorage>', addr=addr)
>>> wait_connected(conn._storage) >>> wait_connected(client)
Now, we'll create a second iterator: Now, we'll create a second iterator:
>>> it2 = conn._storage.iterator() >>> it2 = client.iterator()
If we try to advance the first iterator, we should get an error: If we try to advance the first iterator, we should get an error:
......
...@@ -1561,7 +1561,8 @@ def gracefully_handle_abort_while_storing_many_blobs(): ...@@ -1561,7 +1561,8 @@ def gracefully_handle_abort_while_storing_many_blobs():
>>> logging.getLogger().addHandler(handler) >>> logging.getLogger().addHandler(handler)
>>> addr, _ = start_server(blob_dir='blobs') >>> addr, _ = start_server(blob_dir='blobs')
>>> c = ZEO.connection(addr, blob_dir='cblobs') >>> client = ZEO.client(addr, blob_dir='cblobs')
>>> c = ZODB.connection(client)
>>> c.root.x = ZODB.blob.Blob(b'z'*(1<<20)) >>> c.root.x = ZODB.blob.Blob(b'z'*(1<<20))
>>> c.root.y = ZODB.blob.Blob(b'z'*(1<<2)) >>> c.root.y = ZODB.blob.Blob(b'z'*(1<<2))
>>> t = c.transaction_manager.get() >>> t = c.transaction_manager.get()
...@@ -1578,7 +1579,7 @@ Now we'll try to use the connection, mainly to wait for everything to ...@@ -1578,7 +1579,7 @@ Now we'll try to use the connection, mainly to wait for everything to
get processed. Before we fixed this by making tpc_finish a synchronous get processed. Before we fixed this by making tpc_finish a synchronous
call to the server. we'd get some sort of error here. call to the server. we'd get some sort of error here.
>>> _ = c._storage._server.loadEx(b'\0'*8) >>> _ = client._server.loadEx(b'\0'*8)
>>> c.close() >>> c.close()
......
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