/
/
/
1"""Tests for the rate at which a single queue item is handed to a player."""
2
3from __future__ import annotations
4
5from music_assistant.controllers.streams.constants import (
6 SINGLE_ITEM_READRATE,
7 SINGLE_ITEM_READRATE_INITIAL_BURST,
8)
9
10
11def test_pacing_stays_ahead_of_playback() -> None:
12 """
13 At or below playback rate a player would underrun as soon as its burst ran out.
14
15 The ceiling may be lowered per player, but never to realtime or slower.
16 """
17 assert float(SINGLE_ITEM_READRATE) > 1.0
18
19
20def test_burst_covers_the_start_of_a_track() -> None:
21 """Playback starts from the burst, so it has to be worth more than a moment of audio."""
22 assert float(SINGLE_ITEM_READRATE_INITIAL_BURST) >= 10
23