test: delete slow, timing-based and redundant tests

This commit is contained in:
imSp4rky
2026-12-05 15:20:05 -07:00
parent 783a2fc185
commit 3a0a74e694
292 changed files with 153 additions and 15174 deletions
-28
View File
@@ -2,8 +2,6 @@
import inspect
import logging
import re
import time
from pathlib import Path
from types import SimpleNamespace
@@ -12,7 +10,6 @@ import requests
from unshackle.commands.dl import dl
from unshackle.core.config import config
from unshackle.core.console import console
from unshackle.core.constants import DOWNLOAD_CANCELLED, DOWNLOAD_LICENCE_ONLY
from unshackle.core.dl_options import DEFAULT_DOWNLOAD_PARAMS
from unshackle.core.download_archive import DownloadArchive
@@ -187,13 +184,6 @@ def test_failed_publication_does_not_record(monkeypatch, run):
assert not DownloadArchive(config.directories.cache).path.exists()
def test_all_archived_titles_complete_successfully(run):
run(count=2)
result = run(count=2)
assert len(result.already_present) == 2
assert not result.completed_files and not result.skipped_titles
def test_api_scopes_and_unowned_worker_do_not_use_cli_archive(run):
run()
assert run(scope="api-" + "a" * 64).completed_files
@@ -277,24 +267,6 @@ def test_partial_publication_of_multiple_variants_does_not_record(monkeypatch, r
assert not DownloadArchive(config.directories.cache).path.exists()
def test_wall_clock_step_back_prints_no_negative_elapsed_time(run, monkeypatch):
import unshackle.commands.dl as module
download = module.download_tracks_in_passes
wall = time.time
def download_then_step_back(*args, **kwargs):
download(*args, **kwargs)
monkeypatch.setattr(time, "time", lambda: wall() - 3)
monkeypatch.setattr(module, "download_tracks_in_passes", download_then_step_back)
with console.capture() as captured:
run()
elapsed = re.findall(r"(?:finished|downloaded|titles) in (-?[\dhms]+)", captured.get())
assert len(elapsed) == 3
assert all(re.fullmatch(r"0m\d+s", value) for value in elapsed), elapsed
@pytest.fixture
def get_tracks_calls(monkeypatch):
calls = []