aiida.backends.tests.manage package

Submodules

Tests for the functionality that reads and modifies the caching configuration file.

class aiida.backends.tests.manage.test_caching.CacheConfigTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests the caching configuration.

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

Write a temporary config file, and load the configuration.

tearDown()[source]

Reset the configuration.

test_caching_enabled()[source]

Test get_use_cache when specifying identifier.

test_contextmanager_disable_global()[source]

Test the disable_caching context manager without specific identifier.

test_contextmanager_enable_explicit()[source]

Test the enable_caching context manager.

test_default()[source]

Verify that when not specifying any specific identifier, the default is used, which is set to True.

test_disable_caching()[source]

Test the disable_caching context manager with specific identifier.

test_empty_enabled_disabled()[source]

Test that aiida.manage.caching.configure does not except when either enabled or disabled is None.

This will happen when the configuration file specifies either one of the keys but no actual values, e.g.:

profile_name:
    default: False
    enabled:

In this case, the dictionary parsed by yaml will contain None for the enabled key. Now this will be unlikely, but the same holds when all values are commented:

profile_name:
    default: False
    enabled:
        # - aiida.calculations:templatereplacer

which is not unlikely to occurr in the wild.

test_invalid_config()[source]

Test get_use_cache raises a TypeError if identifier is not a valid entry point string.

test_invalid_enabled_disabled_directives()[source]

Test that configure raises for invalid enable or disable directives.