/
/
# What does this implement/fix? `fetch_playlist` (the helper that downloads and parses remote M3U/PLS playlists) had no direct test coverage — only its pure parsers were tested. The recent charset fix (#5727) touched exactly this function but could only be covered indirectly. This adds a small mocked-response harness and covers the untested branches: - timeout and connection errors are reported as invalid data - HLS playlists are rejected (media playlists only when the caller asks for it, master playlists always) - PLS vs M3U dispatch, both by `.pls` extension and by the `[playlist]` marker - an empty playlist is rejected - a made-up charset from the server still parses, and a bad byte costs one character instead of the whole playlist Test-only change, no behaviour change. ## Types of changes - [ ] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [x] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.