mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
"""Service-independent completion archive matching and persistence."""
|
||||
|
||||
import json
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from dataclasses import replace
|
||||
|
||||
import pytest
|
||||
@@ -107,19 +105,6 @@ def test_history_and_file_deletion_have_no_effect(tmp_path):
|
||||
assert "output.mkv" not in text and "api_history" not in text
|
||||
|
||||
|
||||
def test_concurrent_append_and_truncated_receipt(tmp_path):
|
||||
archive = DownloadArchive(tmp_path)
|
||||
entries = [ArchiveEntry("EXAMPLE", f"episode-{n}", 720, "SDR", "H.264") for n in range(20)]
|
||||
archive.path.parent.mkdir(parents=True)
|
||||
archive.path.write_text('{"version":1,"service":"unfinished')
|
||||
with ThreadPoolExecutor(4) as pool:
|
||||
list(pool.map(lambda entry: DownloadArchive(tmp_path).record([entry]), entries))
|
||||
assert archive.contains(entries)
|
||||
archive.record(entries)
|
||||
valid = [json.loads(line) for line in archive.path.read_text().splitlines()[1:] if line]
|
||||
assert len(valid) == len(entries)
|
||||
|
||||
|
||||
def test_existing_reader_observes_another_writer(tmp_path):
|
||||
archive = DownloadArchive(tmp_path)
|
||||
first = ArchiveEntry("EXAMPLE", "episode-1", 720, "SDR", "H.264")
|
||||
|
||||
Reference in New Issue
Block a user