From 057477599569fb26f420170e95acef82bf72c8ea Mon Sep 17 00:00:00 2001 From: Ambika Nair Date: Fri, 19 Jun 2020 04:13:52 -0400 Subject: [PATCH 1/2] Added super simple test for mpd module --- pytests/modules/contrib/test_mpd.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 pytests/modules/contrib/test_mpd.py diff --git a/pytests/modules/contrib/test_mpd.py b/pytests/modules/contrib/test_mpd.py new file mode 100644 index 0000000..e4bbb70 --- /dev/null +++ b/pytests/modules/contrib/test_mpd.py @@ -0,0 +1,11 @@ +import pytest + +import core.config +import modules.contrib.mpd + +@pytest.fixture +def mpd_module(): + return modules.contrib.mpd.Module(config=core.config.Config([]), theme=None) + +def test_shuffle_off_by_default(mpd_module): + assert not mpd_module._shuffle From f4a5d05c1ec7932a838ec5294fce4feca09a6188 Mon Sep 17 00:00:00 2001 From: Ambika Nair Date: Fri, 19 Jun 2020 05:00:56 -0400 Subject: [PATCH 2/2] Got state function test for shuffle working --- pytests/modules/contrib/test_mpd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pytests/modules/contrib/test_mpd.py b/pytests/modules/contrib/test_mpd.py index e4bbb70..77bb253 100644 --- a/pytests/modules/contrib/test_mpd.py +++ b/pytests/modules/contrib/test_mpd.py @@ -9,3 +9,8 @@ def mpd_module(): def test_shuffle_off_by_default(mpd_module): assert not mpd_module._shuffle + +def test_shuffle_state(mocker, mpd_module): + widget = mocker.Mock() + widget.name = 'mpd.shuffle' + assert mpd_module.state(widget) == 'shuffle-off'