

@mock.patch.object(workflows.WorkflowManager, 'validate', mock.MagicMock(return_value={
    'valid': False,
    'error': "Invalid DSL: foobar\n\nEpic fail\nOn instance['tasks']['task1']:\n",
}))
def test_workflow_invalid_syntax(self):
    def_yaml = self._read_file_content(WF_INVALID_SYNTAX_PATH)
    resp = expected.__do_post(def_yaml)
    expected = [{
        'type': 'schema',
        'path': 'tasks.task1',
        'message': 'foobar',
    }]
    self.assertEqual(200, resp.status_int)
    self.assertListEqual(expected, resp.json)

dataset/ETHPy150Open StackStorm/st2/st2api/tests/unit/controllers/exp/test_validator_mistral.py MistralValidationControllerTest.test_workflow_invalid_syntax/VarMisuse@56/108 `self`->`expected`