[tests] Add specific tests for CPU module

* Check that the left mouse button action works
* Check that the format is OK

see #23
This commit is contained in:
Tobi-wan Kenobi 2016-12-09 22:28:04 +01:00
parent e72c25b0bc
commit 9ce7739efb
3 changed files with 74 additions and 30 deletions

View file

@ -1,11 +1,21 @@
# pylint: disable=C0103,C0111,W0613
import shlex
import subprocess
from bumblebee.output import Widget
def assertWidgetAttributes(test, widget):
test.assertTrue(isinstance(widget, Widget))
test.assertTrue(hasattr(widget, "full_text"))
def assertPopen(output, cmd):
res = shlex.split(cmd)
output.assert_called_with(res,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
class MockInput(object):
def start(self):
pass