fix atomic_write test, don't resuse same key handle for read and write

This commit is contained in:
Yehuda Sadeh 2012-02-15 12:45:31 -08:00
parent 256577fc87
commit 4633fe4c12

View file

@ -2961,10 +2961,12 @@ def _test_atomic_write(file_size):
# verify A's # verify A's
_verify_atomic_key_data(key, file_size, 'A') _verify_atomic_key_data(key, file_size, 'A')
read_key = bucket.get_key(objname)
# create <file_size> file of B's # create <file_size> file of B's
# but try to verify the file before we finish writing all the B's # but try to verify the file before we finish writing all the B's
fp_b = FakeWriteFile(file_size, 'B', fp_b = FakeWriteFile(file_size, 'B',
lambda: _verify_atomic_key_data(key, file_size) lambda: _verify_atomic_key_data(read_key, file_size)
) )
key.set_contents_from_file(fp_b) key.set_contents_from_file(fp_b)