soulsync/tests/metadata/test_metadata_registry.py
Antti Kettunen 55603be14c
Clarify Spotify auth flow and sync UI
- Send Spotify auth completion back to the opener so the settings page refreshes immediately
- Make the local auth flow go straight through to Spotify instead of showing the temporary instruction page
- Keep the remote/docker instruction page available for manual callback setups
- Sync Spotify status, connect/disconnect buttons, and metadata source selection after auth and disconnect
- Keep the disconnect behavior aligned with the active primary metadata source
2026-05-01 11:25:12 +03:00

26 lines
967 B
Python

import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
from core.metadata import registry
def test_spotify_disconnect_source_uses_deezer_when_spotify_is_primary():
assert registry.get_spotify_disconnect_source("spotify") == "deezer"
def test_spotify_disconnect_source_keeps_non_spotify_primary():
assert registry.get_spotify_disconnect_source("discogs") == "discogs"
def test_metadata_source_label_maps_known_sources():
assert registry.get_metadata_source_label("spotify") == "Spotify"
assert registry.get_metadata_source_label("itunes") == "iTunes"
assert registry.get_metadata_source_label("deezer") == "Deezer"
assert registry.get_metadata_source_label("discogs") == "Discogs"
assert registry.get_metadata_source_label("hydrabase") == "Hydrabase"
def test_metadata_source_label_falls_back_to_title_case():
assert registry.get_metadata_source_label("apple_music") == "Apple Music"