feat(dl): let a service force --license-first with the LICENSE_FIRST class variable

This commit is contained in:
imSp4rky
2026-12-05 20:23:47 -07:00
parent ce7cb41eac
commit bd178bc3af
18 changed files with 59 additions and 5 deletions
+16
View File
@@ -128,6 +128,22 @@ def test_without_the_flag_a_track_downloads_before_a_later_licence_fails(
assert run.fetched == ["Video_video.mp4"], result.output
def test_a_service_with_license_first_licenses_every_track_with_no_flag(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
from unshackle.core import services
monkeypatch.setattr(services.ensure_loaded("EXAMPLE"), "LICENSE_FIRST", True)
run = Run(monkeypatch, tmp_path, refuse="audio")
result = run()
assert "Licence refused for track audio" in result.output
assert result.exit_code == 1
assert run.licences == ["video", "audio"]
assert run.fetched == []
def test_the_download_pass_sends_no_second_licence(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
run = Run(monkeypatch, tmp_path)