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:
>>> import os
>>> tids = []
>>> times = []
>>> nothing = transaction.begin()
>>> times.append(new_time())
>>> 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()
>>> times.append(new_time())
>>> with root['blob'].open('w') as file:
... _ = file.write(b'this is blob data 3')
>>> tids.append(blob._p_serial)
>>> transaction.commit()
>>> for i in range(5):
... _ = transaction.begin()
... times.append(new_time())
... with blob.open('w') as file:
... _ = file.write(b'this is blob data ' + str(i).encode())
... 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()
>>> 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