From 885cc09636232ebdee33f3e020784479d3eadf72 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Tue, 31 Mar 2020 20:57:09 +0200 Subject: [PATCH] [core/output] Add some more tests --- tests/core/test_output.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/core/test_output.py b/tests/core/test_output.py index 4099e13..862b338 100644 --- a/tests/core/test_output.py +++ b/tests/core/test_output.py @@ -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