From 9fe091573098901b61477c549b6501bc7b883004 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Sun, 11 Dec 2016 12:26:28 +0100 Subject: [PATCH] [tests] Add mocking for module tests --- tests/modules/test_modules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/modules/test_modules.py b/tests/modules/test_modules.py index b67baa6..99723a0 100644 --- a/tests/modules/test_modules.py +++ b/tests/modules/test_modules.py @@ -26,7 +26,9 @@ class TestGenericModules(unittest.TestCase): for widget in self.objects[mod["name"]].widgets(): self.assertEquals(widget.get("variable", None), None) - def test_widgets(self): + @mock.patch("subprocess.Popen") + def test_widgets(self, mock_output): + mock_output.return_value = MockCommunicate() for mod in self.objects: widgets = self.objects[mod].widgets() for widget in widgets: