[pytests/mpd] provide alternative host check

see #641
This commit is contained in:
Tobias Witek 2020-06-20 13:36:21 +02:00
parent 74de020980
commit d7370307f2

View file

@ -25,6 +25,14 @@ def test_host():
module_with_host = modules.contrib.mpd.Module(config=core.config.Config(['-p', 'mpd.host=sample-host']), theme=None) module_with_host = modules.contrib.mpd.Module(config=core.config.Config(['-p', 'mpd.host=sample-host']), theme=None)
assert module_with_host._hostcmd == ' -h sample-host' assert module_with_host._hostcmd == ' -h sample-host'
def test_host2(mocker):
cli = mocker.patch("modules.contrib.mpd.util.cli")
module_with_host = modules.contrib.mpd.Module(config=core.config.Config(['-p', 'mpd.host=sample-host']), theme=None)
module_with_host.update()
args, kwargs = cli.execute.call_args
assert " -h sample-host" in args[0]
def test_bad_layout(): def test_bad_layout():
pytest.raises(KeyError, modules.contrib.mpd.Module, config=core.config.Config(['-p', 'mpd.layout="mpd.inexistent"']), theme=None) pytest.raises(KeyError, modules.contrib.mpd.Module, config=core.config.Config(['-p', 'mpd.layout="mpd.inexistent"']), theme=None)