

@mock.patch.object(workbooks.WorkbookManager, 'validate', mock.MagicMock(return_value={
    'valid': False,
    'error': "Invalid DSL: 'version' is a required property\n",
}))
def test_missing_version(self):
    def_dict = self._read_yaml_file_as_json(WB_PRE_XFORM_PATH)
    del def_dict['version']
    def_yaml = yaml.safe_dump(def_dict)
    resp = self.__do_post(def_dict)
    expected = [{
        'type': 'schema',
        'path': None,
        'message': "'version' is a required property",
    }]
    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_missing_version/VarMisuse@75/135 `def_yaml`->`def_dict`