def test_lock_error(self):
        mock = MagicMock(return_value={'retcode': 1})
        with patch.dict(mac_desktop.__salt__, {'cmd.run_all': mock}):
            self.assertRaises(CommandExecutionError,
                              mac_desktop.lock)

    # 'say' function tests: 2
Tests that an error is raised when cmd.run_all errors
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/mac_desktop_test.py/MacDesktopTestCase.test_lock_error