def test_execs(self): """ Test to return a list of all files specified as ``ExecStart`` for all services """ mock = MagicMock(return_value=["a", "b"]) with patch.object(systemd, "get_all", mock): mock = MagicMock(return_value={"ExecStart": {"path": "c"}}) with patch.object(systemd, "show", mock): self.assertDictEqual(systemd.execs(), {"a": "c", "b": "c"})
def test_execs(self): ''' Test to return a list of all files specified as ``ExecStart`` for all services ''' mock = MagicMock(return_value=['a', 'b']) with patch.object(systemd, 'get_all', mock): mock = MagicMock(return_value={'ExecStart': {'path': 'c'}}) with patch.object(systemd, 'show', mock): self.assertDictEqual(systemd.execs(), {'a': 'c', 'b': 'c'})