[tests/brightness] Create open call, if it does not exist

Hopefully, this fixes the failing Travis build.
This commit is contained in:
Tobias Witek 2017-06-26 20:33:06 +02:00
parent 62f60a172f
commit fd7c5f6f0b

View file

@ -54,7 +54,7 @@ class TestBrightnessModule(unittest.TestCase):
self.assertEquals(self.module.brightness(self.anyWidget), "020%")
self.assertEquals(len(self.module.brightness(self.anyWidget)), len("100%"))
@mock.patch('bumblebee.modules.brightness.open')
@mock.patch('bumblebee.modules.brightness.open', create=True)
def test_error(self,mock_open):
mock_open.side_effect = FileNotFoundError
self.module.update_all()