[core/theme] Add preparatory work for themes

Add two new parameters: theme and iconset

Add a placeholder class core.theme.Theme, an instance of which is passed
in to the i3 output object (which is the only object that should ever
have need of the theme, hopefully).
This commit is contained in:
Tobias Witek 2020-02-09 13:46:56 +01:00
parent b157aa9fb5
commit 5d971267db
5 changed files with 51 additions and 17 deletions

View file

@ -4,19 +4,18 @@ import core.config
class config(unittest.TestCase):
def setUp(self):
self._someModules = [ 'b', 'x', 'a' ]
self._moreModules = [ 'this', 'module', 'here' ]
def tearDown(self):
pass
self.someModules = [ 'b', 'x', 'a' ]
self.moreModules = [ 'this', 'module', 'here' ]
self.someTheme = 'some-theme'
self.someIconset = 'some-iconset'
def test_module(self):
cfg = core.config.Config([ '-m' ] + self._someModules)
self.assertEqual(self._someModules, cfg.modules())
cfg = core.config.Config([ '-m' ] + self.someModules)
self.assertEqual(self.someModules, cfg.modules())
def test_module_ordering_maintained(self):
cfg = core.config.Config([ '-m' ] + self._someModules + [ '-m' ] + self._moreModules)
self.assertEqual(self._someModules + self._moreModules, cfg.modules())
cfg = core.config.Config([ '-m' ] + self.someModules + [ '-m' ] + self.moreModules)
self.assertEqual(self.someModules + self.moreModules, cfg.modules())
def test_default_interval(self):
cfg = core.config.Config([])
@ -30,4 +29,20 @@ class config(unittest.TestCase):
cfg = core.config.Config([ '-p', 'interval=0.5'])
self.assertEqual(0.5, cfg.interval())
def test_default_theme(self):
cfg = core.config.Config([])
self.assertEqual('default', cfg.theme())
def test_theme(self):
cfg = core.config.Config(['-t', self.someTheme])
self.assertEqual(self.someTheme, cfg.theme())
def test_default_iconset(self):
cfg = core.config.Config([])
self.assertEqual('auto', cfg.iconset())
def test_iconset(self):
cfg = core.config.Config(['-i', self.someIconset])
self.assertEqual(self.someIconset, cfg.iconset())
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4