

@mock.patch.object(workbooks.WorkbookManager, 'validate', mock.MagicMock(return_value={
    'valid': False,
    'error': 'Invalid DSL: Unsupported DSL version\n',
}))
def test_unsupported_version(self):
    def_dict = self._read_yaml_file_as_json(WB_PRE_XFORM_PATH)
    def_dict['version'] = '1.0'
    def_yaml = yaml.safe_dump(def_dict)
    resp = self.__do_post(def_yaml)
    expected = [{
        'type': 'schema',
        'path': None,
        'message': 'Unsupported DSL version',
    }]
    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_unsupported_version/original