tcex.tcex_bin_validate module

TcEx Framework Validate Module.

class tcex.tcex_bin_validate.TcExValidate(_args)[source]

Bases: tcex.tcex_bin.TcExBin

Validate syntax, imports, and schemas.

  • Python and JSON file syntax
  • Python import modules
  • install.json schema
  • layout.json schema
Parameters:_args (namespace) – The argparser args Namespace.
static check_import_stdlib(module)[source]

Check if module is in Python stdlib.

Parameters:module (str) – The name of the module to check.
Returns:Returns True if the module is in the stdlib or template.
Return type:bool
static check_imported(module)[source]

Check whether the provide module can be imported (package installed).

Parameters:module (str) – The name of the module to check availability.
Returns:True if the module can be imported, False otherwise.
Return type:bool
check_imports()[source]

Check the projects top level directory for missing imports.

This method will check only files ending in .py and does not handle imports validation for sub-directories.

check_install_json()[source]

Check all install.json files for valid schema.

check_layout_json()[source]

Check all layout.json files for valid schema.

check_layout_params()[source]

Check that the layout.json is consistent with install.json.

The layout.json files references the params.name from the install.json file. The method will validate that no reference appear for inputs in install.json that don’t exist.

check_syntax(app_path=None)[source]

Run syntax on each “.py” and “.json” file.

Parameters:app_path (str, optional) – Defaults to None. The path of Python files.
install_json_schema

Load install.json schema file.

interactive()[source]

Run in interactive mode.

layout_json_schema

Load layout.json schema file.

print_json()[source]

Print JSON output.

print_results()[source]

Print results.

static status_color(status)[source]

Return the appropriate status color.

static status_value(status)[source]

Return the appropriate status color.