mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 12:35:13 +00:00
feat(tracks): resume segment decryption and rolling merge through the segment store
This commit is contained in:
@@ -273,3 +273,16 @@ def test_service_mounted_adapter_forces_single_process(server, tmp_path, monkeyp
|
||||
pass
|
||||
|
||||
assert len(list(tmp_path.glob("seg_*.bin"))) == n
|
||||
|
||||
|
||||
def test_multiprocess_skips_the_held_indices_and_counts_them_done(server, tmp_path):
|
||||
n = dl.MP_MIN_SEGMENTS
|
||||
urls = [{"url": url(server, f"/seg/{i}.bin")} for i in range(n)]
|
||||
skip = frozenset(range(0, n, 3))
|
||||
|
||||
events = list(
|
||||
dl.requests(urls, tmp_path, "seg_{i:04}.bin", session=Session(), max_workers=4, processes=2, skip=skip)
|
||||
)
|
||||
|
||||
assert sum(e.get("advance", 0) for e in events) == n
|
||||
assert sorted(p.name for p in tmp_path.iterdir()) == [f"seg_{i:04}.bin" for i in range(n) if i not in skip]
|
||||
|
||||
Reference in New Issue
Block a user