From 3c065ceded2a58d5aadbcf64417f2cfc92268a08 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Wed, 26 Feb 2025 18:09:06 +0100 Subject: Refactor fixtures, introduce song pool argument --- solo-tool-project/test/fixtures.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 solo-tool-project/test/fixtures.py (limited to 'solo-tool-project/test/fixtures.py') 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 + -- cgit v1.2.3