diff --git a/doc/NOTES.md b/doc/NOTES.md index 194c1d7..621e16a 100644 --- a/doc/NOTES.md +++ b/doc/NOTES.md @@ -22,3 +22,4 @@ - convert some stuff to simple attributes to reduce LOCs - theme.exclude (battery) - use add_widget() instead of core.widget.Widget() +- use widget index for bumblebee-ctl as alternative (??) diff --git a/tests/core/test_widget.py b/tests/core/test_widget.py index 084a8fc..e71cba2 100644 --- a/tests/core/test_widget.py +++ b/tests/core/test_widget.py @@ -70,4 +70,22 @@ class widget(unittest.TestCase): module.states = ['a', 'b'] self.assertEqual(['state1', 'state2', 'a', 'b'], self.someWidget.state()) + def test_multiple_widget_themes(self): + widget1 = core.widget.Widget(full_text='a') + widget2 = core.widget.Widget(full_text='b') + widget3 = core.widget.Widget(full_text='c') + + module = TestModule(widgets=[widget1, widget2, widget3]) + module.set('theme.test', '1,2,3') + module.set('theme.test2', 'x') + + self.assertEqual('1', widget1.theme('test')) + self.assertEqual('2', widget2.theme('test')) + self.assertEqual('3', widget3.theme('test')) + + self.assertEqual('x', widget1.theme('test2')) + self.assertEqual(None, widget2.theme('test2')) + self.assertEqual(None, widget3.theme('test2')) + + # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4