mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Fix flakey tessie media_player test (#115391)
This commit is contained in:
parent
be8adf9d29
commit
e17c4ab4e3
@ -54,6 +54,13 @@
|
|||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'device_class': 'speaker',
|
'device_class': 'speaker',
|
||||||
'friendly_name': 'Test Media player',
|
'friendly_name': 'Test Media player',
|
||||||
|
'media_album_name': 'Album',
|
||||||
|
'media_artist': 'Artist',
|
||||||
|
'media_duration': 60.0,
|
||||||
|
'media_playlist': 'Playlist',
|
||||||
|
'media_position': 30.0,
|
||||||
|
'media_title': 'Song',
|
||||||
|
'source': 'Spotify',
|
||||||
'supported_features': <MediaPlayerEntityFeature: 0>,
|
'supported_features': <MediaPlayerEntityFeature: 0>,
|
||||||
'volume_level': 0.22580323309042688,
|
'volume_level': 0.22580323309042688,
|
||||||
}),
|
}),
|
||||||
@ -62,6 +69,6 @@
|
|||||||
'last_changed': <ANY>,
|
'last_changed': <ANY>,
|
||||||
'last_reported': <ANY>,
|
'last_reported': <ANY>,
|
||||||
'last_updated': <ANY>,
|
'last_updated': <ANY>,
|
||||||
'state': 'idle',
|
'state': 'playing',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
@ -22,6 +22,8 @@ async def test_media_player(
|
|||||||
freezer: FrozenDateTimeFactory,
|
freezer: FrozenDateTimeFactory,
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
entity_registry: er.EntityRegistry,
|
entity_registry: er.EntityRegistry,
|
||||||
|
mock_get_state,
|
||||||
|
mock_get_status,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Tests that the media player entity is correct when idle."""
|
"""Tests that the media player entity is correct when idle."""
|
||||||
|
|
||||||
@ -38,6 +40,7 @@ async def test_media_player(
|
|||||||
# The refresh fixture has music playing
|
# The refresh fixture has music playing
|
||||||
freezer.tick(WAIT)
|
freezer.tick(WAIT)
|
||||||
async_fire_time_changed(hass)
|
async_fire_time_changed(hass)
|
||||||
|
await hass.async_block_till_done(wait_background_tasks=True)
|
||||||
|
|
||||||
assert hass.states.get(entity_entry.entity_id) == snapshot(
|
assert hass.states.get(entity_entry.entity_id) == snapshot(
|
||||||
name=f"{entity_entry.entity_id}-playing"
|
name=f"{entity_entry.entity_id}-playing"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user