def test_failure_stopping_rcrelationship(self, svc_authorize_mock, svc_run_command_mock): set_module_args({ 'clustername': 'clustername', 'domain': 'domain', 'username': '******', 'password': '******', 'name': 'test_name', 'state': 'stopped', }) svc_run_command_mock.return_value = {} with pytest.raises(AnsibleFailJson) as exc: obj = IBMSVCStartStopReplication() obj.stop() self.assertEqual(True, exc.value.args[0]['failed'])
def test_stop_when_isgroup(self, svc_authorize_mock, svc_run_command_mock): set_module_args({ 'clustername': 'clustername', 'domain': 'domain', 'username': '******', 'password': '******', 'name': 'test_name', 'state': 'stopped', 'isgroup': 'true' }) svc_run_command_mock.return_value = '' obj = IBMSVCStartStopReplication() return_data = obj.stop() self.assertEqual(None, return_data)