[Zodb-checkins]
SVN: ZODB/branches/ctheune-blobszerocopy/src/ZODB/Blobs/tests/consume.txt
- covering the second edge case
Christian Theune
ct at gocept.com
Wed Mar 7 19:11:02 EST 2007
Log message for revision 73045:
- covering the second edge case
Changed:
U ZODB/branches/ctheune-blobszerocopy/src/ZODB/Blobs/tests/consume.txt
-=-
Modified: ZODB/branches/ctheune-blobszerocopy/src/ZODB/Blobs/tests/consume.txt
===================================================================
--- ZODB/branches/ctheune-blobszerocopy/src/ZODB/Blobs/tests/consume.txt 2007-03-08 00:00:36 UTC (rev 73044)
+++ ZODB/branches/ctheune-blobszerocopy/src/ZODB/Blobs/tests/consume.txt 2007-03-08 00:11:01 UTC (rev 73045)
@@ -99,6 +99,26 @@
BlobError: Blob does not exist.
Case 2: We thave uncommitted data, but the link operation fails. The
-exception will be re-raised and the target file will not exist::
+exception will be re-raised and the target file will exist with the previous
+uncomitted data::
- 2. uncommitted data exist, the link fails, the uncommitted data is still there
+
+ >>> input = tempfile.NamedTemporaryFile()
+ >>> input.write('Unimported data')
+ >>> input.flush()
+
+ >>> blob = Blob()
+ >>> blob_writing = blob.open('w')
+ >>> blob_writing.write('Uncommitted data')
+ >>> blob_writing.close()
+
+ >>> blob._os_link = failing_link
+ >>> blob.consumeFile(input.name)
+ Traceback (most recent call last):
+ Exception: I can't link.
+
+The blob did existed before and had uncommitted data, this shouldn't have
+changed::
+
+ >>> blob.open('r').read()
+ 'Uncommitted data'
More information about the Zodb-checkins
mailing list