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"))
|
|
|
|
|
2016-12-09 07:27:01 +01:00
|
|
|
class MockEngine(object):
|
|
|
|
pass
|
|
|
|
|
2016-12-04 17:45:42 +01:00
|
|
|
class MockOutput(object):
|
|
|
|
def start(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def stop(self):
|
|
|
|
pass
|
|
|
|
|
2016-12-08 12:44:52 +01:00
|
|
|
def draw(self, widget, engine):
|
2016-12-04 17:45:42 +01:00
|
|
|
engine.stop()
|
|
|
|
|
2016-12-08 12:44:52 +01:00
|
|
|
def begin(self):
|
|
|
|
pass
|
|
|
|
|
2016-12-04 17:45:42 +01:00
|
|
|
def flush(self):
|
|
|
|
pass
|
|
|
|
|
2016-12-08 12:44:52 +01:00
|
|
|
def end(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
|
2016-12-09 08:58:45 +01:00
|
|
|
self._fg = None
|
|
|
|
self._bg = None
|
2016-12-08 11:31:20 +01:00
|
|
|
|
|
|
|
def set_prefix(self, value):
|
|
|
|
self._prefix = value
|
|
|
|
|
|
|
|
def set_suffix(self, value):
|
|
|
|
self._suffix = value
|
|
|
|
|
2016-12-09 08:58:45 +01:00
|
|
|
def set_fg(self, value):
|
|
|
|
self._fg = value
|
|
|
|
|
|
|
|
def set_bg(self, value):
|
|
|
|
self._bg = 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-09 08:58:45 +01:00
|
|
|
def fg(self, widget):
|
|
|
|
return self._fg
|
|
|
|
|
|
|
|
def bg(self, widget):
|
|
|
|
return self._bg
|
|
|
|
|
2016-12-04 12:53:18 +01:00
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|