diff options
author | Eddy Pedroni <epedroni@pm.me> | 2025-02-23 09:07:45 +0100 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2025-02-23 09:07:45 +0100 |
commit | 5ee474d6e6ef79b45bc2ca2a950a8950ef099397 (patch) | |
tree | 923a52d2ede9305f63c0d044d04833749ac21546 | |
parent | 7c0c69431a1ba4939e739a5429c03c067bf6e1dd (diff) |
Remove solo tool controller
-rw-r--r-- | solo-tool-project/src/solo_tool/solo_tool_controller.py | 22 | ||||
-rw-r--r-- | solo-tool-project/test/solo_tool_controller_integrationtest.py | 88 |
2 files changed, 0 insertions, 110 deletions
diff --git a/solo-tool-project/src/solo_tool/solo_tool_controller.py b/solo-tool-project/src/solo_tool/solo_tool_controller.py deleted file mode 100644 index 0529570..0000000 --- a/solo-tool-project/src/solo_tool/solo_tool_controller.py +++ /dev/null @@ -1,22 +0,0 @@ -import os - -from solo_tool.solo_tool import SoloTool - -class SoloToolController: - def __init__(self, soloTool: SoloTool): - self._soloTool = soloTool - - def nextSong(self): - current = self._soloTool.song - if current is None: - self._soloTool.song = 0 - else: - self._soloTool.song = current + 1 - - def previousSong(self): - current = self._soloTool.song - if current is None: - self._soloTool.song = 0 - else: - self._soloTool.song = current - 1 - diff --git a/solo-tool-project/test/solo_tool_controller_integrationtest.py b/solo-tool-project/test/solo_tool_controller_integrationtest.py deleted file mode 100644 index 8eb09f9..0000000 --- a/solo-tool-project/test/solo_tool_controller_integrationtest.py +++ /dev/null @@ -1,88 +0,0 @@ -import pathlib -import shutil -import pytest - -from solo_tool.solo_tool_controller import SoloToolController -from solo_tool.solo_tool import SoloTool - -pytestmark = pytest.mark.skip(reason="not yet implemented") - -@pytest.fixture -def prepared_tmp_path(tmp_path): - testFiles = [ - "test.flac", - "test.mp3", - "test_session.json" - ] - for f in testFiles: - shutil.copy(pathlib.Path(f), tmp_path) - return tmp_path - -@pytest.fixture -def soloTool(prepared_tmp_path): - st = SoloTool() - st.loadSession(prepared_tmp_path / "test_session.json") - return st - -@pytest.fixture -def uut(soloTool): - return SoloToolController(soloTool) - -def test_previousSong(uut, soloTool): - called = False - receivedValue = None - def callback(value): - nonlocal called, receivedValue - called = True - receivedValue = value - - soloTool.registerCurrentSongCallback(callback) - - soloTool.song == None - assert not called - - uut.previousSong() - soloTool.song == 0 - assert called - assert receivedValue == 0 - called = False - - uut.previousSong() - soloTool.song == 0 - assert not called - - soloTool.song = 1 - uut.previousSong() - soloTool.song == 0 - assert called - assert receivedValue == 0 - called = False - -def test_nextSong(uut, soloTool): - called = False - receivedValue = None - def callback(value): - nonlocal called, receivedValue - called = True - receivedValue = value - - soloTool.registerCurrentSongCallback(callback) - - soloTool.song == None - assert not called - - uut.nextSong() - soloTool.song == 0 - assert called - assert receivedValue == 0 - called = False - - uut.nextSong() - soloTool.song == 1 - assert called - assert receivedValue == 1 - called = False - - uut.nextSong() - soloTool.song == 1 - assert not called |