2016-12-04 18:10:04 +01:00
|
|
|
# pylint: disable=C0103,C0111,W0613
|
2016-12-04 12:53:18 +01:00
|
|
|
|
2016-12-04 17:45:42 +01:00
|
|
|
from bumblebee.output import Widget
|
|
|
|
|
|
|
|
def assertWidgetAttributes(test, widget):
|
|
|
|
test.assertTrue(isinstance(widget, Widget))
|
|
|
|
test.assertTrue(hasattr(widget, "full_text"))
|
|
|
|
|
|
|
|
class MockOutput(object):
|
|
|
|
def start(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def stop(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def draw(self, widgets, engine):
|
|
|
|
engine.stop()
|
|
|
|
|
|
|
|
def flush(self):
|
|
|
|
pass
|
|
|
|
|
2016-12-04 12:53:18 +01:00
|
|
|
class MockWidget(object):
|
|
|
|
def __init__(self, text):
|
|
|
|
self._text = text
|
2016-12-08 12:09:21 +01:00
|
|
|
self._module = None
|
|
|
|
|
|
|
|
def set_module(self, name):
|
|
|
|
self._module = name
|
2016-12-04 12:53:18 +01:00
|
|
|
|
2016-12-08 08:44:54 +01:00
|
|
|
def update(self, widgets):
|
|
|
|
pass
|
|
|
|
|
2016-12-08 12:09:21 +01:00
|
|
|
def module(self):
|
|
|
|
return self._module
|
|
|
|
|
2016-12-04 17:45:42 +01:00
|
|
|
def full_text(self):
|
2016-12-04 12:53:18 +01:00
|
|
|
return self._text
|
|
|
|
|
2016-12-08 11:31:20 +01:00
|
|
|
class MockTheme(object):
|
|
|
|
def __init__(self):
|
|
|
|
self._prefix = None
|
|
|
|
self._suffix = None
|
|
|
|
|
|
|
|
def set_prefix(self, value):
|
|
|
|
self._prefix = value
|
|
|
|
|
|
|
|
def set_suffix(self, value):
|
|
|
|
self._suffix = value
|
|
|
|
|
2016-12-08 11:52:47 +01:00
|
|
|
def prefix(self, widget):
|
2016-12-08 11:31:20 +01:00
|
|
|
return self._prefix
|
|
|
|
|
2016-12-08 11:52:47 +01:00
|
|
|
def suffix(self, widget):
|
2016-12-08 11:31:20 +01:00
|
|
|
return self._suffix
|
|
|
|
|
2016-12-04 12:53:18 +01:00
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|