mirror of
https://github.com/Horizontal42/Sort_YM.git
synced 2026-11-10 15:42:02 +03:00
report/apply/digest can now point at any Yandex Music playlist via a share link instead of only the account's likes. Fetches the playlist's tracks and artist genres straight into memory (no disk cache, nothing persisted) and feeds them through the existing build_rows/render_digest/ apply_classification pipeline. apply supports --label to keep a foreign playlist's tracks in separate genre playlists instead of merging them into your own. Closes a gap where UnauthorizedError went uncaught anywhere.
18 lines
600 B
Python
18 lines
600 B
Python
import pytest
|
|
|
|
from sort_ym import cli
|
|
|
|
|
|
def test_apply_label_without_source_fails_before_any_network_access():
|
|
with pytest.raises(SystemExit, match="--source"):
|
|
cli.main(["apply", "--yes", "--label", "Друг"])
|
|
|
|
|
|
def test_apply_empty_label_fails_before_any_network_access():
|
|
with pytest.raises(SystemExit, match="пустым"):
|
|
cli.main(["apply", "--yes", "--source", "https://music.yandex.ru/users/a/playlists/1", "--label", " "])
|
|
|
|
|
|
def test_apply_without_yes_fails_regardless_of_source():
|
|
with pytest.raises(SystemExit, match="--yes"):
|
|
cli.main(["apply"])
|