/
/
/
# What does this implement/fix? The Chromecast media-status tests drove the handler with a plain `MagicMock` standing in for the player, so every `self._helper()` call inside the handler was answered by the mock instead of running. When #5670 split that handler into seven helpers, this forced a shim that bound each helper back onto the mock, plus an extra test to keep that binding list complete. The tests now build a real (but not `__init__`'d) `ChromecastPlayer` with mocked collaborators, so the helpers simply run. The shim and its guard test are gone, and the tests no longer need updating when the handler is split up further. **Related issue (if applicable):** - follow-up on #5670 ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives the label from the ticked box and applies it automatically; the release-notes generator uses that same label to slot this change into the next release notes. --> - [ ] 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` ## Changes - Build the media-status test player from `ChromecastPlayer.__new__` with mocked collaborators, instead of a full `MagicMock` - Delete `tests/providers/chromecast/helpers.py` and `test_media_status_helper_binding.py` - Call the handler as a normal bound method, dropping the unbound-call wrappers and their casts - Seed the fakes with the playback state the handler is expected to clear, so those assertions still bite on a real instance - Remove two dead `_attr_active_source = None` stores in `_update_playback_state`, which `_update_active_source` always overwrites All existing assertions are unchanged. ## 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.