[tests] add more tests

This commit is contained in:
tobi-wan-kenobi 2020-05-16 11:55:25 +02:00
parent eea3c758de
commit 7584366adc
4 changed files with 28 additions and 3 deletions

View file

@ -7,6 +7,7 @@ import core.config
class TestModule(core.module.Module):
@core.decorators.never
def __init__(self, config=None, theme=None):
config = core.config.Config([])
super().__init__(config, theme, core.widget.Widget(self.get))
@ -16,7 +17,6 @@ class TestModule(core.module.Module):
def get(self, widget):
return self.text
class config(unittest.TestCase):
def setUp(self):
self.module = TestModule()
@ -24,6 +24,10 @@ class config(unittest.TestCase):
self.width = 10
self.module.set("scrolling.width", self.width)
def test_never(self):
self.module = TestModule()
self.assertEqual("never", self.module.parameter("interval"))
def test_no_text(self):
self.assertEqual("", self.module.text)
self.assertEqual("", self.module.get(self.widget))