[tests] Refactor by removing getter/setter methods

Instead of having get/set methods for simple attributes, use the
attributes directly.

see #23
This commit is contained in:
Tobi-wan Kenobi 2016-12-09 11:42:02 +01:00
parent c52cb99518
commit 068968bbf5
3 changed files with 19 additions and 34 deletions

View file

@ -60,7 +60,7 @@ class TestI3BarOutput(unittest.TestCase):
@mock.patch("sys.stdout", new_callable=StringIO)
def test_prefix(self, stdout):
self.theme.set_prefix(" - ")
self.theme.attr_prefix = " - "
self.output.draw(self.someWidget)
self.output.flush()
result = json.loads(stdout.getvalue())[0]
@ -70,7 +70,7 @@ class TestI3BarOutput(unittest.TestCase):
@mock.patch("sys.stdout", new_callable=StringIO)
def test_suffix(self, stdout):
self.theme.set_suffix(" - ")
self.theme.attr_suffix = " - "
self.output.draw(self.someWidget)
self.output.flush()
result = json.loads(stdout.getvalue())[0]
@ -80,8 +80,8 @@ class TestI3BarOutput(unittest.TestCase):
@mock.patch("sys.stdout", new_callable=StringIO)
def test_bothfix(self, stdout):
self.theme.set_suffix(" - ")
self.theme.set_prefix(" * ")
self.theme.attr_suffix = " - "
self.theme.attr_prefix = " * "
self.output.draw(self.someWidget)
self.output.flush()
result = json.loads(stdout.getvalue())[0]
@ -93,8 +93,8 @@ class TestI3BarOutput(unittest.TestCase):
@mock.patch("sys.stdout", new_callable=StringIO)
def test_colors(self, stdout):
self.theme.set_fg(self.anyColor)
self.theme.set_bg(self.anotherColor)
self.theme.attr_fg = self.anyColor
self.theme.attr_bg = self.anotherColor
self.output.draw(self.someWidget)
self.output.flush()
result = json.loads(stdout.getvalue())[0]