ecap5_treq.config module

class ecap5_treq.config.Config(path: str = None)

Bases: object

A Config stores input parameters such as paths to the specification, tests, testdata or the traceability matrix.

defaults() None

Initializes mandatory configuration fields

get(key: str) str

Return the configuration data pointed by key

Parameters:

key (str) – key used to identify the configuration data

Returns:

the configuration data pointed by key

Return type:

str

load_config(path: str) None

Loads the Config object with data from the configuration file pointed by path.

Parameters:

path (str) – path to the configuration file.

set(key: str, value: str) None

Set the value of the configuration data pointed by key to the provided value.

Parameters:
  • key (str) – key used to identify the configuration data

  • value (str) – value to be written

set_path(key: str, path: str) None

Set the path value of the configuration data pointed by key to the provided value.

This function is used instead of set() when dealing with paths as this function converts paths to absolute paths.

Parameters:
  • key (str) – key used to identify the configuration data

  • path (str) – path to be written

class ecap5_treq.config.SpecFormat

Bases: object

A SpecFormat details the specification language format

RST = 'RST'
TEX = 'TEX'
ecap5_treq.config.path_to_abs_path(path: str, config_path: str = None) str

Converts a path to absolute

Parameters:
  • path (str) – the path to convert to absolute path

  • config_path (str) – path to the configuration file if provided, None otherwise

Returns:

The relative path from either the config directory or current directory to the file pointed by path

Return type:

str