

@mock.patch.object(workflows.WorkflowManager, 'validate', mock.MagicMock(return_value={
    'valid': False,
    'error': 'Parse error: unexpected end of statement.',
}))
def test_workflow_invalid_yaql(self):
    def_yaml = self._read_file_content(WF_INVALID_YAQL_PATH)
    resp = self.__do_post(def_yaml)
    expected = [{
        'type': 'yaql',
        'path': None,
        'message': 'unexpected end of statement.',
    }]
    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_yaql/original