diff options
author | Eddy Pedroni <epedroni@pm.me> | 2025-02-26 18:09:06 +0100 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2025-02-26 18:25:41 +0100 |
commit | 3c065ceded2a58d5aadbcf64417f2cfc92268a08 (patch) | |
tree | 95e965feeb2313dd657c8335c57b16fffefff9a0 /solo-tool-project/test/fixtures.py | |
parent | 0821b21761a6d47ac1d34c2142365dbaa361b79e (diff) |
Refactor fixtures, introduce song pool argument
Diffstat (limited to 'solo-tool-project/test/fixtures.py')
-rw-r--r-- | solo-tool-project/test/fixtures.py | 32 |
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 + |