The testing module¶
- nomenclature.testing.assert_valid_yaml(path)[source]¶
Assert that all yaml files in path can be parsed without errors
- nomenclature.testing.assert_valid_structure(path, definitions='definitions', mappings=None, required_data=None, validate_data=None, dimensions=None)[source]¶
Assert that path can be initialized as a
DataStructureDefinition
- Parameters:
- pathPath
Project directory to be validated
- definitionsstr, optional
Name of the definitions folder, defaults to “definitions”
- mappingsstr, optional
Name of the mappings folder, defaults to “mappings” (if this folder exists)
- required_datastr, optional
Name of the folder for required data, defaults to “required_data” (if this folder exists)
- validate_datastr, optional
Name of the folder for data validation criteria, defaults to “validate_date” (if this folder exists)
- dimensionslist[str], optional
Dimensions to be checked, defaults to all sub-folders of definitions
Notes
- Folder structure of path:
A definitions folder is required and must be a valid
DataStructureDefinition
The definitions folder must contain sub-folder(s) to validate
If a mappings folder exists, it must be a valid
RegionProcessor