From e603a2cb2635ef5edef1bf4904449599ddaa730a Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Sun, 11 Dec 2016 08:14:55 +0100 Subject: [PATCH] [tests/battery] Forgot a mock in previous commit --- tests/modules/test_battery.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/modules/test_battery.py b/tests/modules/test_battery.py index c2e0b59..499a0fa 100644 --- a/tests/modules/test_battery.py +++ b/tests/modules/test_battery.py @@ -53,10 +53,12 @@ class TestBatteryModule(unittest.TestCase): self.module.update(self.module.widgets()) self.assertTrue("critical" in self.module.widgets()[0].state()) + @mock.patch("os.path.exists") @mock.patch("{}.open".format("__builtin__" if sys.version_info[0] < 3 else "builtins")) @mock.patch("subprocess.Popen") - def test_warning(self, mock_output, mock_open): + def test_warning(self, mock_output, mock_open, mock_exists): mock_open.return_value = MockOpen() + mock_exists.return_value = True mock_open.return_value.returns("22") self.config.set("battery.critical", "20") self.config.set("battery.warning", "25")