Beispiel #1
0
    1: 'template_id field contains incorrect string value.',
    2: 'Duplicate template_id definition.',
    3: 'template_id does not appear in the definition block.',
    4: 'Syntax error: ',
    5: 'Invalid yaml format: ',

    # definitions section 20-39
    20: 'definitions section must contain entities field.',
    21: 'definitions section is a mandatory section.',

    # Entities status messages 40-59
    41: 'Entity definition must contain template_id field.',
    42: 'Entity definition must contain category field.',
    43: 'At least one entity must be defined.',
    45: 'Invalid entity category. Category must be from types: '
        '{categories}'.format(categories=EntityCategory.categories()),
    46: 'Entity field is required.',
    47: 'Invalid regular expression defined in field:',

    # metadata section status messages 60-79
    60: 'metadata section must contain id field.',
    62: 'metadata is a mandatory section.',
    63: 'Unsupported version. Version must be one of: {versions}'
        .format(versions=TemplateSchemaFactory.supported_versions()),
    64: 'metadata section must contain a type field in version 2. Type must be'
        ' one of: {types}'.format(types=TemplateTypes.types()),
    65: 'Invalid template type. Type must be one of: {types}'
        .format(types=TemplateTypes.types()),

    # scenarios section status messages 80-99
    80: 'scenarios is a mandatory section.',
 def f(v):
     if str(v) in EntityCategory.categories():
         return str(v)
     else:
         raise Invalid(msg or 45)
 def f(v):
     if str(v) in EntityCategory.categories():
         return str(v)
     else:
         raise Invalid(msg or 45)
Beispiel #4
0
    0: 'Template validation is OK',
    1: 'template_id field contains incorrect string value.',
    2: 'Duplicate template_id definition.',
    3: 'template_id does not appear in the definition block.',
    4: 'Syntax error: ',

    # definitions section 20-39
    20: 'definitions section must contain entities field.',
    21: 'definitions section is a mandatory section.',

    # Entities status messages 40-59
    41: 'Entity definition must contain template_id field.',
    42: 'Entity definition must contain category field.',
    43: 'At least one entity must be defined.',
    45: 'Invalid entity category. Category must be from types: '
        '{categories}'.format(categories=EntityCategory.categories()),
    46: 'Entity field is required.',

    # metadata section status messages 60-79
    60: 'metadata section must contain id field.',
    62: 'metadata is a mandatory section.',

    # scenarios section status messages 80-99
    80: 'scenarios is a mandatory section.',
    81: 'At least one scenario must be defined.',
    82: 'scenario field is required.',
    83: 'Entity definition must contain condition field.',
    84: 'Entity definition must contain actions field.',
    85: 'Failed to convert condition.',

    # relationships status messages 100-119