mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-28 22:22:13 +03:00
core/Validator: black pass, and remove extraneous ,
in constants
This commit is contained in:
parent
32fb1b00ab
commit
47095d7615
@ -12,9 +12,9 @@ from jsonschema import validate as json_validate
|
|||||||
class ValidationSeverity(IntEnum):
|
class ValidationSeverity(IntEnum):
|
||||||
"""Enum of validation status."""
|
"""Enum of validation status."""
|
||||||
|
|
||||||
OK = 0,
|
OK = 0
|
||||||
WARN = 1,
|
WARN = 1
|
||||||
ERROR = 2,
|
ERROR = 2
|
||||||
FATAL = 3
|
FATAL = 3
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ class Validator(object):
|
|||||||
self.schemas[schema_ref] = schema
|
self.schemas[schema_ref] = schema
|
||||||
|
|
||||||
except simplejson.JSONDecodeError:
|
except simplejson.JSONDecodeError:
|
||||||
raise Exception(f'SCHEMA: Failed to load: {schema_ref}')
|
raise Exception(f"SCHEMA: Failed to load: {schema_ref}")
|
||||||
|
|
||||||
def validate(self, json_object: Dict) -> ValidationResults:
|
def validate(self, json_object: Dict) -> ValidationResults:
|
||||||
"""
|
"""
|
||||||
@ -83,7 +83,7 @@ class Validator(object):
|
|||||||
# We don't want to go out to the Internet and retrieve unknown schemas.
|
# We don't want to go out to the Internet and retrieve unknown schemas.
|
||||||
results.add(
|
results.add(
|
||||||
ValidationSeverity.FATAL,
|
ValidationSeverity.FATAL,
|
||||||
JsonValidationException(f'Schema {schema_ref} is unknown, unable to validate.')
|
JsonValidationException(f"Schema {schema_ref} is unknown, unable to validate."),
|
||||||
)
|
)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user