mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-25 23:51:07 +00:00
write the data file more safely
This commit is contained in:
parent
dd51c7a3f1
commit
ed74fdc746
@ -128,28 +128,27 @@ async def test_generate(reactor, request, alice):
|
|||||||
FORMATS,
|
FORMATS,
|
||||||
))
|
))
|
||||||
results = generate(reactor, request, alice, space)
|
results = generate(reactor, request, alice, space)
|
||||||
with vectors.DATA_PATH.open("w") as f:
|
vectors.DATA_PATH.setContent(safe_dump({
|
||||||
f.write(safe_dump({
|
"version": "2023-01-03",
|
||||||
"version": "2023-01-03",
|
"vector": [
|
||||||
"vector": [
|
{
|
||||||
{
|
"convergence": vectors.encode_bytes(case.convergence),
|
||||||
"convergence": vectors.encode_bytes(case.convergence),
|
"format": case.fmt,
|
||||||
"format": case.fmt,
|
"sample": {
|
||||||
"sample": {
|
"seed": vectors.encode_bytes(case.seed_data.seed),
|
||||||
"seed": vectors.encode_bytes(case.seed_data.seed),
|
"length": case.seed_data.length,
|
||||||
"length": case.seed_data.length,
|
},
|
||||||
},
|
"zfec": {
|
||||||
"zfec": {
|
"segmentSize": SEGMENT_SIZE,
|
||||||
"segmentSize": SEGMENT_SIZE,
|
"required": case.params.required,
|
||||||
"required": case.params.required,
|
"total": case.params.total,
|
||||||
"total": case.params.total,
|
},
|
||||||
},
|
"expected": cap,
|
||||||
"expected": cap,
|
}
|
||||||
}
|
async for (case, cap)
|
||||||
async for (case, cap)
|
in results
|
||||||
in results
|
],
|
||||||
],
|
}))
|
||||||
}))
|
|
||||||
|
|
||||||
|
|
||||||
async def generate(
|
async def generate(
|
||||||
|
Loading…
Reference in New Issue
Block a user