chore: create missing dunstctl tests
This commit is contained in:
parent
40de07ba2e
commit
1580951474
1 changed files with 19 additions and 1 deletions
|
@ -1,6 +1,5 @@
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import util.cli
|
|
||||||
import core.config
|
import core.config
|
||||||
import modules.contrib.dunstctl
|
import modules.contrib.dunstctl
|
||||||
|
|
||||||
|
@ -13,6 +12,25 @@ def build_module():
|
||||||
def test_load_module():
|
def test_load_module():
|
||||||
__import__("modules.contrib.dunstctl")
|
__import__("modules.contrib.dunstctl")
|
||||||
|
|
||||||
|
def test_input_registration(mocker):
|
||||||
|
input_register = mocker.patch('core.input.register')
|
||||||
|
|
||||||
|
module = build_module()
|
||||||
|
|
||||||
|
input_register.assert_called_with(
|
||||||
|
module,
|
||||||
|
button=core.input.LEFT_MOUSE,
|
||||||
|
cmd=module.toggle_state
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_dunst_toggle_state(mocker):
|
||||||
|
command = mocker.patch('util.cli.execute')
|
||||||
|
|
||||||
|
module = build_module()
|
||||||
|
|
||||||
|
module.toggle_state(None)
|
||||||
|
command.assert_called_with('dunstctl set-paused toggle', ignore_errors=True)
|
||||||
|
|
||||||
def test_dunst_running(mocker):
|
def test_dunst_running(mocker):
|
||||||
command = mocker.patch('util.cli.execute', return_value=(0, "false"))
|
command = mocker.patch('util.cli.execute', return_value=(0, "false"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue