From d3fc5094f8a8fb4ed27c1c78d5522d3c91ef3185 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Mon, 2 Jan 2017 22:26:57 +0100 Subject: [PATCH] [modules/gpmdp] Make unit tests run through * full_text needs to return a string *always* * relax full_text check to also allow unicode results --- bumblebee/modules/gpmdp.py | 2 +- tests/modules/test_modules.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/gpmdp.py b/bumblebee/modules/gpmdp.py index af96e9b..57f3c1a 100644 --- a/bumblebee/modules/gpmdp.py +++ b/bumblebee/modules/gpmdp.py @@ -31,7 +31,7 @@ class Module(bumblebee.engine.Module): self._tags = None def description(self, widget): - return self._tags + return self._tags if self._tags else "n/a" def update(self, widgets): self._load_song() diff --git a/tests/modules/test_modules.py b/tests/modules/test_modules.py index 4c54a93..59db4fa 100644 --- a/tests/modules/test_modules.py +++ b/tests/modules/test_modules.py @@ -39,7 +39,7 @@ class TestGenericModules(unittest.TestCase): assertWidgetAttributes(self, widget) widget.set("variable", "value") self.assertEquals(widget.get("variable", None), "value") - self.assertTrue(isinstance(widget.full_text(), str)) + self.assertTrue(isinstance(widget.full_text(), str) or isinstance(widget.full_text(), unicode)) @mock.patch("subprocess.Popen") def test_update(self, mock_output):