def test_stop(self): """ Test for Stop the specified service """ mock = MagicMock(return_value=True) with patch.dict(gentoo_service.__salt__, {'cmd.retcode': mock}): self.assertFalse(gentoo_service.stop('name')) mock.assert_called_once_with('/etc/init.d/name stop', python_shell=False)