[core/output] Add some more tests
This commit is contained in:
parent
232dcb733e
commit
885cc09636
1 changed files with 16 additions and 0 deletions
|
@ -18,6 +18,10 @@ class i3(unittest.TestCase):
|
|||
self.paddedTheme = core.theme.Theme(raw_data = {
|
||||
'defaults': { 'padding': ' ' }
|
||||
});
|
||||
self.separator = '***';
|
||||
self.separatorTheme = core.theme.Theme(raw_data = {
|
||||
'defaults': { 'separator': self.separator }
|
||||
});
|
||||
|
||||
def test_start(self):
|
||||
core.event.clear()
|
||||
|
@ -65,4 +69,16 @@ class i3(unittest.TestCase):
|
|||
result = self.i3.__pad(self.someModule, self.someModule.widget(), 'abc')
|
||||
self.assertEqual(' abc ', result)
|
||||
|
||||
def test_no_separator(self):
|
||||
result = self.i3.__separator(self.someModule, self.someModule.widget())
|
||||
self.assertEqual([], result)
|
||||
|
||||
def test_separator(self):
|
||||
self.i3.theme(self.separatorTheme)
|
||||
result = self.i3.__separator(self.someModule, self.someModule.widget())
|
||||
self.assertEqual(1, len(result))
|
||||
self.assertEqual('***', result[0]['full_text'])
|
||||
self.assertTrue(result[0].get('_decorator', False))
|
||||
self.assertEqual(self.separatorTheme.bg(self.someModule.widget()), result[0]['color'])
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
Loading…
Reference in a new issue