From 1c8da1b5768af8ed58a807d366e0b838f0b55752 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 15 Jul 2020 11:50:51 +0100 Subject: [PATCH] Add test for play_stop for #6 --- tests/test_frontend.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_frontend.py b/tests/test_frontend.py index 56e2455..c749c7e 100644 --- a/tests/test_frontend.py +++ b/tests/test_frontend.py @@ -66,6 +66,23 @@ def test_frontend_handler_dispatch_play_pause(): stop_mopidy_core() +def test_frontend_handler_dispatch_play_stop(): + sys.modules["RPi"] = mock.Mock() + sys.modules["RPi.GPIO"] = mock.Mock() + + frontend = frontend_lib.RaspberryGPIOFrontend( + dummy_config, dummy_mopidy_core() + ) + + ext = Extension() + schema = ext.get_config_schema() + settings = schema["bcm1"].deserialize("play_stop,active_low,30") + + frontend.dispatch_input(settings) + + stop_mopidy_core() + + def test_frontend_handler_dispatch_next(): sys.modules["RPi"] = mock.Mock() sys.modules["RPi.GPIO"] = mock.Mock()