vantage6.node.context.TestingConfigurationManager#
- class TestingConfigurationManager(conf_class=<class 'vantage6.common.configuration_manager.Configuration'>, name=None)#
Bases:
ConfigurationManager
- __init__(conf_class=<class 'vantage6.common.configuration_manager.Configuration'>, name=None)#
Methods
__init__
([conf_class, name])from_file
(path[, conf_class])Load a configuration from a file.
get
()Get a configuration from the configuration manager.
load
(path)Load a configuration from a file.
put
(config)Add a configuration to the configuration manager.
save
(path)Save the configuration to a file.
Attributes
VALIDATORS
Check if the configuration manager is empty.
- classmethod from_file(path, conf_class=<class 'vantage6.common.configuration_manager.Configuration'>)#
Load a configuration from a file.
- Parameters:
path (Path | str) – The path to the file to load the configuration from.
conf_class (Type[Configuration]) – The class to use for the configuration.
- Returns:
The configuration manager with the configuration.
- Return type:
- Raises:
AssertionError – If the name of the configuration could not be extracted from the file path.
- get()#
Get a configuration from the configuration manager.
- Returns:
The configuration.
- Return type:
- property is_empty: bool#
Check if the configuration manager is empty.
- Returns:
Whether or not the configuration manager is empty.
- Return type:
bool
- load(path)#
Load a configuration from a file.
- Parameters:
path (Path | str) – The path to the file to load the configuration from.
- Return type:
None
- put(config)#
Add a configuration to the configuration manager.
- Parameters:
config (dict) – The configuration to add.
- Raises:
AssertionError – If the configuration is not valid.
- Return type:
None
- save(path)#
Save the configuration to a file.
- Parameters:
path (Path | str) – The path to the file to save the configuration to.
- Return type:
None