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:
@@ -76,6 +76,28 @@ class Harness:
|
||||
self.skipped.append(track)
|
||||
|
||||
|
||||
def test_ctrl_c_cancels_the_tracks_still_downloading():
|
||||
seen = {}
|
||||
|
||||
def run_one(track, _index):
|
||||
if track.id == "a":
|
||||
raise KeyboardInterrupt
|
||||
# a deadline, not a delay: without the cancel this waits it out and records False
|
||||
seen[track.id] = DOWNLOAD_CANCELLED.wait(timeout=10)
|
||||
|
||||
with pytest.raises(KeyboardInterrupt):
|
||||
download_tracks_in_passes(
|
||||
[make_video(), make_audio()],
|
||||
2,
|
||||
run_one,
|
||||
skip_subtitle_errors=False,
|
||||
on_subtitle_skipped=lambda track: None,
|
||||
)
|
||||
|
||||
assert seen == {"v": True}
|
||||
assert DOWNLOAD_CANCELLED.is_set()
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clear_event():
|
||||
DOWNLOAD_CANCELLED.clear()
|
||||
|
||||
Reference in New Issue
Block a user