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 --- .../test/solo_tool_songs_integrationtest.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'solo-tool-project/test/solo_tool_songs_integrationtest.py') diff --git a/solo-tool-project/test/solo_tool_songs_integrationtest.py b/solo-tool-project/test/solo_tool_songs_integrationtest.py index 092ea93..6030d19 100644 --- a/solo-tool-project/test/solo_tool_songs_integrationtest.py +++ b/solo-tool-project/test/solo_tool_songs_integrationtest.py @@ -1,22 +1,6 @@ import pytest -from solo_tool.solo_tool import SoloTool -from player_mock import Player as MockPlayer - -@pytest.fixture -def mockPlayer(): - return MockPlayer() - -@pytest.fixture -def uut(mockPlayer): - return SoloTool(player=mockPlayer) - -@pytest.fixture -def testSongs(): - return [ - "test.flac", - "test.mp3" - ] +from fixtures import soloTool as uut, songPool, mockPlayer, testSongs def test_songSelectionFlow(uut, mockPlayer, testSongs): # Initially, song list is empty and no song is selected @@ -33,7 +17,7 @@ def test_songSelectionFlow(uut, mockPlayer, testSongs): # Subsequently added songs are not selected automatically # Song list order is addition order for i, song in enumerate(testSongs[1:]): - uut.addSong(testSongs[1]) + uut.addSong(song) assert uut.song == 0 assert mockPlayer.currentSong == testSongs[0] assert uut.songs == testSongs[0:i + 2] -- cgit v1.2.3