def test_enabled(self): ''' Test for Return True if the named service is enabled, false otherwise ''' mock = MagicMock(return_value=['A']) with patch.object(debian_service, 'get_enabled', mock): self.assertFalse(debian_service.enabled('name'))
def test_enabled(self): """ Test for Return True if the named service is enabled, false otherwise """ mock = MagicMock(return_value=["A"]) with patch.object(debian_service, "get_enabled", mock): self.assertFalse(debian_service.enabled("name"))
def test_enabled(self): mock = MagicMock(return_value=["foo"]) with patch.object(debian_service, "get_enabled", mock): assert debian_service.enabled("foo") assert not debian_service.enabled("bar")