[tests/battery] Forgot a mock in previous commit

This commit is contained in:
Tobi-wan Kenobi 2016-12-11 08:14:55 +01:00
parent ef224fdbb6
commit e603a2cb26

View file

@ -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")