[core] Remove "intelligent" theme accessors

To simplify code, remove the auto-generated theme accessors for
attributes, and instead use a generic "get" method.
This commit is contained in:
tobi-wan-kenobi 2020-04-07 20:41:09 +02:00
parent f32affa563
commit c0cc1ccd75
4 changed files with 26 additions and 38 deletions

View file

@ -81,6 +81,12 @@ class i3(unittest.TestCase):
self.assertEqual(1, len(result))
self.assertEqual('***', result[0].dict()['full_text'])
self.assertTrue(result[0].dict().get('_decorator', False))
self.assertEqual(self.separatorTheme.bg(self.someModule.widget()), result[0].dict()['color'])
self.assertEqual(self.separatorTheme.get('bg', self.someModule.widget()), result[0].dict()['color'])
def test_dump_json(self):
obj = unittest.mock.MagicMock()
obj.dict = unittest.mock.MagicMock()
core.output.dump_json(obj)
obj.dict_assert_called_once_with()
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4