1 parent ea1c373 commit 5301a8fCopy full SHA for 5301a8f
1 file changed
SimpleDjIA/tests/test_session.py
@@ -0,0 +1,21 @@
1
+from pathlib import Path
2
+
3
+from simple_djia.models import RankedTrack, Track
4
+from simple_djia.profiles import get_scene
5
+from simple_djia.session import Session
6
7
8
+def ranked(title: str) -> RankedTrack:
9
+ return RankedTrack(Track(Path(f"/{title}.ogg"), title), score=1.0)
10
11
12
+def test_next_advances_until_end_without_repeating_last_track():
13
+ session = Session(
14
+ scene=get_scene("restaurant_piano"),
15
+ playlist=[ranked("one"), ranked("two")],
16
+ )
17
18
+ assert session.next() == session.playlist[1]
19
+ assert session.current_index == 1
20
+ assert session.next() is None
21
0 commit comments