Skip to content

test(deezer): add unit tests for geoblocking, encrypted fallback, and metadata methods#1002

Open
berettavexee wants to merge 1 commit into
nathom:devfrom
berettavexee:deezer-tests
Open

test(deezer): add unit tests for geoblocking, encrypted fallback, and metadata methods#1002
berettavexee wants to merge 1 commit into
nathom:devfrom
berettavexee:deezer-tests

Conversation

@berettavexee

@berettavexee berettavexee commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Adds 9 new unit tests to the existing Deezer test suite, covering paths that were previously untested.

get_downloadable

  • WrongGeolocation with a FALLBACK ID: verifies the recursive retry path resolves correctly
  • WrongGeolocation without a FALLBACK ID: verifies NonStreamableError is raised
  • get_track_url returning None: verifies fallback to _get_encrypted_file_url

Metadata methods

  • get_track: happy path — track dict returned with full album metadata embedded
  • get_playlist: normalized response contains title, tracks, and track_total
  • get_metadata dispatch: routes to the correct handler by media_type
  • get_metadata invalid type: raises for unsupported media types
  • search: returns a one-element list wrapping the API response when results exist
  • search: returns an empty list when total is 0

All tests are purely unit tests using the existing mock_deezer_client fixture (no ARL required).

Test plan

  • pytest tests/test_deezer.py passes with no ARL (13 passed, 1 skipped)

🤖 Generated with Claude Code

… metadata methods

Adds 9 new unit tests to the existing Deezer test suite:

- WrongGeolocation with FALLBACK ID: verifies the recursive retry path
- WrongGeolocation without FALLBACK: verifies NonStreamableError is raised
- get_track_url returning None: verifies fallback to _get_encrypted_file_url
- get_track: happy path with embedded album metadata
- get_playlist: normalized response with tracks and track_total
- get_metadata dispatch: routes to the correct handler by media type
- get_metadata invalid type: raises for unsupported media types
- search: returns results list; returns empty list when total is 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant