aiida_test_cache.archive_cache package¶
Module contents¶
Defines fixtures for automatically creating / loading an AiiDA DB export, to enable AiiDA - level caching.
- aiida_test_cache.archive_cache.absolute_archive_path(request: FixtureRequest, testing_config: Config, archive_cache_forbid_migration: bool, tmp_path_factory: TempPathFactory) Callable [source]¶
Fixture to get the absolute filepath for a given archive
An absolute file path is not modified
- If the given path is relative the absolute path is constructed with respect to
either - the default_data_dir specified in the archive_cache section of the config file - if no such option is specified a directory caches is used in the folder of the current test file
- aiida_test_cache.archive_cache.archive_cache_forbid_migration(request: FixtureRequest) bool [source]¶
Read whether aiida is forbidden from migrating the test archives if their versions are incompatible.
- aiida_test_cache.archive_cache.archive_cache_overwrite(request: FixtureRequest) bool [source]¶
Read whether the test archives should be overwritten in this test run.
- aiida_test_cache.archive_cache.enable_archive_cache(liberal_hash: None, archive_cache_forbid_migration: bool, archive_cache_overwrite: bool, absolute_archive_path: Callable) Callable [source]¶
Fixture to use in a with block - Before the block the given cache is loaded (if it exists) - within this block the caching of AiiDA is enabled. - At the end an AiiDA export can be created (if test data should be overwritten) Requires an absolute path to the export file to load or export to. Export the provenance of all calcjobs nodes within the test.
- aiida_test_cache.archive_cache.liberal_hash(monkeypatch: MonkeyPatch, testing_config: Config) None [source]¶
Monkeypatch .get_objects_to_hash of Code, CalcJobNodes and core Data nodes of aiida-core to not include the uuid of the computer and less information of the code node in the hash and remove aiida-core version from hash