diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-03 19:14:04 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-03 19:14:04 +0100 |
commit | bfa2abe556269de927e399a0547b18126a78ff96 (patch) | |
tree | 7f830706db5f49c3c5034a2cf7fe46a60170451a /midi_launchpad_mini_integrationtest.py | |
parent | e35f7280760bf8ed37c76fffc4d53529aea5e168 (diff) |
Added test, some error checking in Qt interface
Diffstat (limited to 'midi_launchpad_mini_integrationtest.py')
-rw-r--r-- | midi_launchpad_mini_integrationtest.py | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/midi_launchpad_mini_integrationtest.py b/midi_launchpad_mini_integrationtest.py index beeee51..0bb9a82 100644 --- a/midi_launchpad_mini_integrationtest.py +++ b/midi_launchpad_mini_integrationtest.py @@ -64,8 +64,7 @@ def test_startStopAndPauseButtons(uut, midiWrapperMock, playerMock): midiWrapperMock.simulateInput(playPauseButton) assert playerMock.state == PlayerMock.PLAYING - msg = midiWrapperMock.getLatestMessage() - assert msg == (playPauseButton, MidiController.LED_GREEN, 0) + assert midiWrapperMock.getLatestMessage() == (playPauseButton, MidiController.LED_GREEN, 0) midiWrapperMock.simulateInput(stopButton) assert playerMock.state == PlayerMock.STOPPED @@ -88,6 +87,29 @@ def test_startStopAndPauseButtons(uut, midiWrapperMock, playerMock): midiWrapperMock.simulateInput(stopButton) assert playerMock.state == PlayerMock.STOPPED +def test_startPauseButtonLed(uut, midiWrapperMock, playerMock, soloTool): + playPauseButton = 112 + stopButton = 96 + uut.connect() + + assert playerMock.state == PlayerMock.STOPPED + + soloTool.play() + assert playerMock.state == PlayerMock.PLAYING + assert midiWrapperMock.getLatestMessage() == (playPauseButton, MidiController.LED_GREEN, 0) + + soloTool.stop() + assert playerMock.state == PlayerMock.STOPPED + assert midiWrapperMock.getLatestMessage() == (playPauseButton, MidiController.LED_YELLOW, 0) + + soloTool.pause() + assert midiWrapperMock.getLatestMessage() == (playPauseButton, MidiController.LED_YELLOW, 0) + assert playerMock.state == PlayerMock.PAUSED + + soloTool.play() + assert midiWrapperMock.getLatestMessage() == (playPauseButton, MidiController.LED_GREEN, 0) + assert playerMock.state == PlayerMock.PLAYING + def test_jumpToAButton(uut, midiWrapperMock, soloTool, playerMock): ab = (0.5, 0.6) uut.connect() |