vantage6.cli.configuration_manager.TestingConfigurationManager#

class TestingConfigurationManager(name, *args, **kwargs)#

Bases: ConfigurationManager

__init__(name, *args, **kwargs)#

Methods

__init__(name, *args, **kwargs)

from_file(path)

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

is_empty

Check if the configuration manager is empty.

classmethod from_file(path)#

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:

ConfigurationManager

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:

Configuration

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