forked from kenzuya/unshackle
feat(dl): let a service force --license-first with the LICENSE_FIRST class variable
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user