aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project/test/fixtures.py
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2025-02-26 18:09:06 +0100
committerEddy Pedroni <epedroni@pm.me>2025-02-26 18:25:41 +0100
commit3c065ceded2a58d5aadbcf64417f2cfc92268a08 (patch)
tree95e965feeb2313dd657c8335c57b16fffefff9a0 /solo-tool-project/test/fixtures.py
parent0821b21761a6d47ac1d34c2142365dbaa361b79e (diff)
Refactor fixtures, introduce song pool argument
Diffstat (limited to 'solo-tool-project/test/fixtures.py')
-rw-r--r--solo-tool-project/test/fixtures.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/solo-tool-project/test/fixtures.py b/solo-tool-project/test/fixtures.py
new file mode 100644
index 0000000..f70901b
--- /dev/null
+++ b/solo-tool-project/test/fixtures.py
@@ -0,0 +1,32 @@
+import pytest
+from pathlib import Path
+import os
+
+from solo_tool.solo_tool import SoloTool
+from player_mock import Player as MockPlayer
+
+@pytest.fixture
+def mockPlayer():
+ return MockPlayer()
+
+@pytest.fixture
+def songPool(tmp_path):
+ return tmp_path / "songs"
+
+@pytest.fixture
+def soloTool(mockPlayer, songPool):
+ return SoloTool(songPool, player=mockPlayer)
+
+@pytest.fixture
+def testSongs(songPool):
+ songs = [
+ songPool / "test.flac",
+ songPool / "test.mp3",
+ songPool / "test.mp4"
+ ]
+
+ os.mkdir(songPool)
+ for song in songs:
+ song.touch()
+ return songs
+