buildtest.schemas.utils

Utility and helper functions for schemas.

Module Contents

Functions

load_schema(path)

Load a json schema file, the file extension must be .schema.json

load_recipe(path)

Load a yaml recipe file. The file must be in .yml extension for buildtest to load.

Attributes

here

buildtest.schemas.utils.here
buildtest.schemas.utils.load_schema(path)[source]

Load a json schema file, the file extension must be .schema.json

Parameters

path (str) – Path to schema file

Returns

Return loaded schema as JSON document

Return type

dict

Raises

SystemExit – If filepath doesn’t exist or schema file doesn’t ends in .schema.json

buildtest.schemas.utils.load_recipe(path)[source]

Load a yaml recipe file. The file must be in .yml extension for buildtest to load.

Parameters

path (str) – The full path to buildspec recipe

Returns

a dict containing buildspec that is defined in YAML format

Return type

dict

Raises

SystemExit – If filepath doesn’t exist or doesn’t end in .yml extension