def test_assign_cmd_failed(self):
        cmd = {'pid': 3548, 'retcode': 1, 'stderr': '',
               'stdout': 'net.inet.icmp.icmplim: 250 -> 50'}
        mock_cmd = MagicMock(return_value=cmd)
        with patch.dict(mac_sysctl.__salt__, {'cmd.run_all': mock_cmd}):
            self.assertRaises(CommandExecutionError,
                              mac_sysctl.assign,
                              'net.inet.icmp.icmplim', 50)
Tests if the assignment was successful or not
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/mac_sysctl_test.py/DarwinSysctlTestCase.test_assign_cmd_failed