Configuration

The TestServer can be configured with .yaml-files which can be found in the subdirectory /config.

ConfigManager

class config.configmanager.ConfigManager

Manager which handles the config files for the TestServer.

static check(data: object=None) → bool

Check the data against the schema.

Parameters:data – Data from the yml file
Returns:‘True’ if check is successfully
static get_firmware_dict() -> (<class 'bool'>, <class 'dict'>)

Read the firmware config from the file.

Returns:‘Tuple’ with bool and dictionary with all firmware properties from the file
static get_firmware_list() → []

Read the firmware config from the file.

Returns:List with all firmware properties from the file
static get_firmware_property(prop: str='') → object

Read the firmware config from the file and give the property back.

Parameters:prop – Property from firmware
Returns:Value of the property from firmware
static get_framework_config() → []

Read the framework config file.

Returns:Dictionary with the output from the file
static get_framework_schema() → []

Read the framework schema file.

Returns:Dictionary with the output from the file
static get_power_strip_dict() -> (<class 'bool'>, <class 'dict'>)

Read the power strip config from the file.

Returns:‘Tuple’ with bool and dictionary with all power-strip properties from the file
static get_power_strip_list() → []

Read the power-strip config file.

Returns:List with any power-strips objects from the file
static get_routers_dict() -> (<class 'bool'>, <class 'dict'>)

Read the routers from config file.

Returns:‘Tuple’ with bool and dictionary with all Routers
static get_routers_list() → []

Read the Routers from the config.

Returns:List with any Router-Obj from the file
static get_server_dict() -> (<class 'bool'>, <class 'dict'>)

Read the server config from the file.

Returns:‘Tuple’ with bool and dictionary with all server properties from the file.
static get_server_list() → []

Read the server config from the file.

Returns:List with all server properties from the file
static get_server_property(prop: str='') → object

Read the server config from the file and give the property back.

Parameters:prop – Property from server
Returns:Value of the property from server
static get_test_dict() -> (<class 'bool'>, <class 'dict'>)

Read the test config from the file.

Returns:‘Tuple’ with bool and dictionary with all test properties from the file
static get_test_sets() → []

Read the test config from the file.

Returns:List with all test properties from the file
static get_web_interface_dict() -> (<class 'bool'>, <class 'dict'>)

Read the web interface config from the file.

Returns:‘Tuple’ with bool and dictionary with all web interface properties from the file
static get_web_interface_list() → []

Read the web interface config from the file.

Returns:List with all web interface properties from the file, have intern dictionaries
static get_web_interface_property(prop: str='') → object

Read the web interface config from the file and give the property back.

Parameters:prop – Property from web interface
Returns:Value of the property from web interface
static read_file(file_path: str='') → []

Read a config file from the path.

Parameters:file_path – File path
Returns:Array with the output from the file
classmethod set_config_path(config_path: str='')

Set the path from the files.

Parameters:config_path – Where the files are