Commit d09694fc authored by Julien Muchembled's avatar Julien Muchembled

Simplify a test in blob_packing

parent 78860659
...@@ -31,41 +31,19 @@ Put some revisions of a blob object in our database and on the filesystem: ...@@ -31,41 +31,19 @@ Put some revisions of a blob object in our database and on the filesystem:
>>> import os >>> import os
>>> tids = [] >>> tids = []
>>> times = [] >>> times = []
>>> nothing = transaction.begin()
>>> times.append(new_time())
>>> blob = Blob() >>> blob = Blob()
>>> with blob.open('w') as file:
... _ = file.write(b'this is blob data 0')
>>> root['blob'] = blob
>>> transaction.commit()
>>> nothing = transaction.begin()
>>> times.append(new_time())
>>> with root['blob'].open('w') as file:
... _ = file.write(b'this is blob data 1')
>>> tids.append(blob._p_serial)
>>> transaction.commit()
>>> nothing = transaction.begin()
>>> times.append(new_time())
>>> with root['blob'].open('w') as file:
... _ = file.write(b'this is blob data 2')
>>> tids.append(blob._p_serial)
>>> transaction.commit()
>>> nothing = transaction.begin() >>> for i in range(5):
>>> times.append(new_time()) ... _ = transaction.begin()
>>> with root['blob'].open('w') as file: ... times.append(new_time())
... _ = file.write(b'this is blob data 3') ... with blob.open('w') as file:
>>> tids.append(blob._p_serial) ... _ = file.write(b'this is blob data ' + str(i).encode())
>>> transaction.commit() ... if i:
... tids.append(blob._p_serial)
... else:
... root['blob'] = blob
... transaction.commit()
>>> nothing = transaction.begin()
>>> times.append(new_time())
>>> with root['blob'].open('w') as file:
... _ = file.write(b'this is blob data 4')
>>> tids.append(blob._p_serial)
>>> transaction.commit()
>>> blob._p_activate() >>> blob._p_activate()
>>> tids.append(blob._p_serial) >>> tids.append(blob._p_serial)
......
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