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-09 11:49:59 +01:00
|
|
|
self.module = None
|
2016-12-04 12:53:18 +01:00
|
|
|
|
2016-12-08 08:44:54 +01:00
|
|
|
def update(self, widgets):
|
|
|
|
pass
|
|
|
|
|
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):
|
2016-12-09 11:42:02 +01:00
|
|
|
self.attr_prefix = None
|
|
|
|
self.attr_suffix = None
|
|
|
|
self.attr_fg = None
|
|
|
|
self.attr_bg = None
|
2016-12-09 12:55:16 +01:00
|
|
|
self.attr_separator = None
|
|
|
|
self.attr_separator_block_width = 0
|
2016-12-09 08:58:45 +01:00
|
|
|
|
2016-12-09 13:06:08 +01:00
|
|
|
def padding(self, widget):
|
|
|
|
return ""
|
|
|
|
|
2016-12-09 12:28:39 +01:00
|
|
|
def reset(self):
|
|
|
|
pass
|
|
|
|
|
2016-12-09 12:55:16 +01:00
|
|
|
def separator_block_width(self, widget):
|
|
|
|
return self.attr_separator_block_width
|
|
|
|
|
|
|
|
def separator(self, widget):
|
|
|
|
return self.attr_separator
|
|
|
|
|
2016-12-09 13:06:08 +01:00
|
|
|
def prefix(self, widget, default=None):
|
2016-12-09 11:42:02 +01:00
|
|
|
return self.attr_prefix
|
2016-12-08 11:31:20 +01:00
|
|
|
|
2016-12-09 13:06:08 +01:00
|
|
|
def suffix(self, widget, default=None):
|
2016-12-09 11:42:02 +01:00
|
|
|
return self.attr_suffix
|
2016-12-08 11:31:20 +01:00
|
|
|
|
2016-12-09 08:58:45 +01:00
|
|
|
def fg(self, widget):
|
2016-12-09 11:42:02 +01:00
|
|
|
return self.attr_fg
|
2016-12-09 08:58:45 +01:00
|
|
|
|
|
|
|
def bg(self, widget):
|
2016-12-09 11:42:02 +01:00
|
|
|
return self.attr_bg
|
2016-12-09 08:58:45 +01:00
|
|
|
|
2016-12-04 12:53:18 +01:00
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|