diff --git a/eido/const.py b/eido/const.py index e6af5e5..b0e8775 100644 --- a/eido/const.py +++ b/eido/const.py @@ -14,8 +14,9 @@ CONVERT_CMD: "Convert PEP format using filters", } PROP_KEY = "properties" -REQUIRED_FILES_KEY = "required_files" -FILES_KEY = "files" + +TANGIBLE_KEY = "tangible" +SIZING_KEY = "sizing" # sample schema input validation key names, these values are required by looper # to refer to the dict values @@ -34,7 +35,9 @@ "FILTERS_CMD", "SUBPARSER_MSGS", ] -SCHEMA_SECTIONS = ["PROP_KEY", "REQUIRED_FILES_KEY", "FILES_KEY"] + +SCHEMA_SECTIONS = ["PROP_KEY", "TANGIBLE_KEY", "SIZING_KEY"] + SCHEMA_VALIDAION_KEYS = [ "MISSING_KEY", "REQUIRED_INPUTS_KEY", diff --git a/eido/inspection.py b/eido/inspection.py index 2f47ae5..fe379cb 100644 --- a/eido/inspection.py +++ b/eido/inspection.py @@ -7,12 +7,12 @@ from .const import ( ALL_INPUTS_KEY, - FILES_KEY, INPUT_FILE_SIZE_KEY, MISSING_KEY, PROP_KEY, - REQUIRED_FILES_KEY, REQUIRED_INPUTS_KEY, + SIZING_KEY, + TANGIBLE_KEY, ) from .schema import read_schema from .validation import _validate_sample_object, _get_attr_values @@ -68,11 +68,11 @@ def get_input_files_size(sample, schema): required_inputs = set() schema = schema[-1] # use only first schema, in case there are imports sample_schema_dict = schema["properties"]["_samples"]["items"] - if FILES_KEY in sample_schema_dict: - all_inputs.update(_get_attr_values(sample, sample_schema_dict[FILES_KEY])) - if REQUIRED_FILES_KEY in sample_schema_dict: + if SIZING_KEY in sample_schema_dict: + all_inputs.update(_get_attr_values(sample, sample_schema_dict[SIZING_KEY])) + if TANGIBLE_KEY in sample_schema_dict: required_inputs = set( - _get_attr_values(sample, sample_schema_dict[REQUIRED_FILES_KEY]) + _get_attr_values(sample, sample_schema_dict[TANGIBLE_KEY]) ) all_inputs.update(required_inputs) with catch_warnings(record=True) as w: diff --git a/eido/validation.py b/eido/validation.py index 37b674e..37154d1 100644 --- a/eido/validation.py +++ b/eido/validation.py @@ -13,9 +13,9 @@ import peppy from .const import ( - FILES_KEY, PROP_KEY, - REQUIRED_FILES_KEY, + SIZING_KEY, + TANGIBLE_KEY, ) from .exceptions import PathAttrNotFoundError from .schema import preprocess_schema, read_schema @@ -212,11 +212,11 @@ def validate_input_files( required_inputs = set() schema = schemas[-1] # use only first schema, in case there are imports sample_schema_dict = schema["properties"]["_samples"]["items"] - if FILES_KEY in sample_schema_dict: - all_inputs.update(_get_attr_values(sample, sample_schema_dict[FILES_KEY])) - if REQUIRED_FILES_KEY in sample_schema_dict: + if SIZING_KEY in sample_schema_dict: + all_inputs.update(_get_attr_values(sample, sample_schema_dict[SIZING_KEY])) + if TANGIBLE_KEY in sample_schema_dict: required_inputs = set( - _get_attr_values(sample, sample_schema_dict[REQUIRED_FILES_KEY]) + _get_attr_values(sample, sample_schema_dict[TANGIBLE_KEY]) ) all_inputs.update(required_inputs) diff --git a/tests/data/schemas/schema_test_file_exist.yaml b/tests/data/schemas/schema_test_file_exist.yaml index 8653210..e1814b8 100644 --- a/tests/data/schemas/schema_test_file_exist.yaml +++ b/tests/data/schemas/schema_test_file_exist.yaml @@ -21,10 +21,10 @@ properties: - type: array items: type: string - files: + sizing: - local_files - required_files: + tangible: - local_files required: