bumblebee-status/tests/util.py
Tobi-wan Kenobi 64f5fc100e [core/theme] Add prefix/postfix methods
Add a way to specify prefix and postfix strings to the full text of a
widget's text. Currently, the theme does not fill those yet.

see #23
2016-12-08 11:31:20 +01:00

49 lines
973 B
Python

# pylint: disable=C0103,C0111,W0613
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
class MockWidget(object):
def __init__(self, text):
self._text = text
def update(self, widgets):
pass
def full_text(self):
return self._text
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
def prefix(self):
return self._prefix
def suffix(self):
return self._suffix
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4