[modules/cmus] Re-add cmus module
Re-add a first version of the cmus module originally contributed by @paxy97. Still missing: * Icon themes (status) * On-click actions see #23
This commit is contained in:
parent
9ce7739efb
commit
87e76b9e40
6 changed files with 102 additions and 1 deletions
30
tests/modules/test_cmus.py
Normal file
30
tests/modules/test_cmus.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
# pylint: disable=C0103,C0111
|
||||
|
||||
import json
|
||||
import unittest
|
||||
import mock
|
||||
|
||||
import bumblebee.input
|
||||
from bumblebee.input import I3BarInput
|
||||
from bumblebee.modules.cmus import Module
|
||||
from tests.util import MockEngine, MockConfig, assertPopen
|
||||
|
||||
class TestCmusModule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.engine = MockEngine()
|
||||
self.module = Module(engine=self.engine, config={"config": MockConfig()})
|
||||
|
||||
@mock.patch("subprocess.Popen")
|
||||
def test_read_song(self, mock_output):
|
||||
rv = mock.Mock()
|
||||
rv.configure_mock(**{
|
||||
"communicate.return_value": ("out", None)
|
||||
})
|
||||
mock_output.return_value = rv
|
||||
self.module.update(self.module.widgets())
|
||||
assertPopen(mock_output, "cmus-remote -Q")
|
||||
|
||||
def test_widgets(self):
|
||||
self.assertTrue(len(self.module.widgets()), 5)
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
Loading…
Add table
Add a link
Reference in a new issue