aiida.backends.tests.manage.configuration package

Submodules

Tests for the Config class.

class aiida.backends.tests.manage.configuration.test_config.TestConfig(methodName='runTest')[source]

Bases: aiida.backends.testbase.AiidaTestCase

Tests for the Config class.

__module__ = 'aiida.backends.tests.manage.configuration.test_config'
setUp()[source]

Setup a mock config.

tearDown()[source]

Clean the temporary folder.

test_basic_properties()[source]

Test the basic properties of the Config class.

test_construct_empty_dictionary()[source]

Constructing with empty dictionary should create basic skeleton.

test_default_profile()[source]

Test setting and getting default profile.

test_option()[source]

Test the setter, unsetter and getter of configuration options.

test_option_global_only()[source]

Test that global_only options are only set globally even if a profile specific scope is set.

test_profiles()[source]

Test the properties related to retrieving, creating, updating and removing profiles.

test_set_option_override()[source]

Test that global_only options are only set globally even if a profile specific scope is set.

test_setting_versions()[source]

Test the version setters.

test_store()[source]

Test that the store method writes the configuration properly to disk.

class aiida.backends.tests.manage.configuration.test_config.TestConfigDirectory(methodName='runTest')[source]

Bases: aiida.backends.testbase.AiidaTestCase

Tests to make sure that the detection and creation of configuration folder is done correctly.

__module__ = 'aiida.backends.tests.manage.configuration.test_config'
classmethod setUpClass(*args, **kwargs)[source]

Save the current environment variable settings.

classmethod tearDownClass(*args, **kwargs)[source]

Restore the original environment variable settings.

test_environment_variable_not_set()[source]

Check that if the environment variable is not set, config folder will be created in DEFAULT_AIIDA_PATH.

To make sure we do not mess with the actual default .aiida folder, which often lives in the home folder we create a temporary directory and set the DEFAULT_AIIDA_PATH to it.

test_environment_variable_path_including_config_folder()[source]

If AIIDA_PATH is set and the path contains the base name of the config folder, it should work, i.e:

/home/user/.virtualenvs/dev/ /home/user/.virtualenvs/dev/.aiida

Are both legal and will both result in the same configuration folder path.

test_environment_variable_set_multiple_path()[source]

If AIIDA_PATH is set with multiple paths without actual config folder, one is created in the last.

test_environment_variable_set_single_path_with_config_folder()[source]

If AIIDA_PATH is set and already contains a configuration folder it should simply be used.

test_environment_variable_set_single_path_without_config_folder()[source]

If AIIDA_PATH is set but does not contain a configuration folder, it should be created.

Tests for the configuration options.

class aiida.backends.tests.manage.configuration.test_options.TestConfigurationOptions(methodName='runTest')[source]

Bases: aiida.backends.testbase.AiidaTestCase

Tests for the Options class.

__module__ = 'aiida.backends.tests.manage.configuration.test_options'
test_get_config_option_default(**kwargs)
test_get_config_option_global(**kwargs)
test_get_config_option_profile_specific(**kwargs)
test_get_option()[source]

Test get_option function.

test_get_option_names()[source]

Test get_option_names function.

test_options()[source]

Test that all defined options can be converted into Option namedtuples.

test_parse_option()[source]

Test parse_option function.

Tests for the Profile class.

class aiida.backends.tests.manage.configuration.test_profile.TestProfile(methodName='runTest')[source]

Bases: aiida.backends.testbase.AiidaTestCase

Tests for the Profile class.

__module__ = 'aiida.backends.tests.manage.configuration.test_profile'
classmethod setUpClass(*args, **kwargs)[source]

Setup a mock profile.

test_base_properties()[source]

Test the basic properties of a Profile instance.

test_is_test_profile()[source]

Test that a profile whose name starts with test_ is marked as a test profile.

test_set_option()[source]

Test the set_option method.