Merge pull request #656 from rosalogia/main

Added super simple test for mpd module
This commit is contained in:
tobi-wan-kenobi 2020-06-19 12:02:31 +02:00 committed by GitHub
commit 639c373578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,16 @@
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
def test_shuffle_state(mocker, mpd_module):
widget = mocker.Mock()
widget.name = 'mpd.shuffle'
assert mpd_module.state(widget) == 'shuffle-off'