From fe4bc310a5939c477e809b1e345de524bf0c4335 Mon Sep 17 00:00:00 2001 From: Markus Binsteiner Date: Mon, 8 Apr 2024 14:10:05 +0200 Subject: [PATCH] chore: fix test archive --- .../archives/nand_true.0.10.kiarchive.json | 2 +- tests/test_archives/test_archive_import.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/resources/archives/nand_true.0.10.kiarchive.json b/tests/resources/archives/nand_true.0.10.kiarchive.json index 45fe522df..7d7b8af09 100644 --- a/tests/resources/archives/nand_true.0.10.kiarchive.json +++ b/tests/resources/archives/nand_true.0.10.kiarchive.json @@ -1 +1 @@ -{"type_name":"nand_true.0.10.kiarchive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"data_archive_info":{"type_name":"4232cb61-dea1-4aec-b112-31c47f3b933c","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"archive_id":"4232cb61-dea1-4aec-b112-31c47f3b933c","archive_alias":"nand_true.0.10","archive_type_info":{"type_name":"sqlite_data_archive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[{"name":"Markus Binsteiner","email":"markus@frkl.io"}]},"context":{"references":{"source_repo":{"url":"https://github.com/DHARPA-Project/kiara","desc":"The kiara project git repository."},"documentation":{"url":"https://dharpa.org/kiara_documentation/","desc":"The url for kiara documentation."}},"tags":[],"labels":{"package":"kiara"}},"python_class":{"python_class_name":"SqliteDataArchive","python_module_name":"kiara.registries.data.data_store.sqlite_store","full_name":"kiara.registries.data.data_store.sqlite_store.SqliteDataArchive"},"is_writable":false,"supported_item_types":["data"]},"config":{"sqlite_db_path":"/home/markus/projects/kiara/kiara/tests/resources/archives/nand_true.0.10.kiarchive","use_wal_mode":false},"details":{"no_values":6,"value_ids":["0503fd1c-7c02-4070-9440-b53b20d844ec","52f46bd7-0bc6-4da7-8345-2bc2c217ec4c","6762dfa2-4127-48d9-bda4-2fcd260b5a9f","b6bdc921-35d6-43e6-ba20-25e617b7e5ea","b749f980-34d7-4f2d-81af-5d516cbe0753","f1cc63af-0627-4dd0-8f75-fb916872c375"],"dynamic_archive":false,"size":135168},"metadata":{"archive_id":"4232cb61-dea1-4aec-b112-31c47f3b933c","archive_name":"nand_true.0.10"}},"alias_archive_info":{"type_name":"4232cb61-dea1-4aec-b112-31c47f3b933c","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"archive_id":"4232cb61-dea1-4aec-b112-31c47f3b933c","archive_alias":"nand_true.0.10","archive_type_info":{"type_name":"sqlite_alias_archive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[{"name":"Markus Binsteiner","email":"markus@frkl.io"}]},"context":{"references":{"source_repo":{"url":"https://github.com/DHARPA-Project/kiara","desc":"The kiara project git repository."},"documentation":{"url":"https://dharpa.org/kiara_documentation/","desc":"The url for kiara documentation."}},"tags":[],"labels":{"package":"kiara"}},"python_class":{"python_class_name":"SqliteAliasArchive","python_module_name":"kiara.registries.aliases.sqlite_store","full_name":"kiara.registries.aliases.sqlite_store.SqliteAliasArchive"},"is_writable":false,"supported_item_types":["alias"]},"config":{"sqlite_db_path":"/home/markus/projects/kiara/kiara/tests/resources/archives/nand_true.0.10.kiarchive","use_wal_mode":false},"details":{"no_aliases":0,"aliases":[],"dynamic_archive":false},"metadata":{"archive_id":"4232cb61-dea1-4aec-b112-31c47f3b933c","archive_name":"nand_true.0.10"}},"metadata_archive_info":{"type_name":"4232cb61-dea1-4aec-b112-31c47f3b933c","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"archive_id":"4232cb61-dea1-4aec-b112-31c47f3b933c","archive_alias":"nand_true.0.10","archive_type_info":{"type_name":"sqlite_metadata_archive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[{"name":"Markus Binsteiner","email":"markus@frkl.io"}]},"context":{"references":{"source_repo":{"url":"https://github.com/DHARPA-Project/kiara","desc":"The kiara project git repository."},"documentation":{"url":"https://dharpa.org/kiara_documentation/","desc":"The url for kiara documentation."}},"tags":[],"labels":{"package":"kiara"}},"python_class":{"python_class_name":"SqliteMetadataArchive","python_module_name":"kiara.registries.metadata.metadata_store.sqlite_store","full_name":"kiara.registries.metadata.metadata_store.sqlite_store.SqliteMetadataArchive"},"is_writable":false,"supported_item_types":["metadata"]},"config":{"sqlite_db_path":"/home/markus/projects/kiara/kiara/tests/resources/archives/nand_true.0.10.kiarchive","use_wal_mode":false},"details":{"no_metadata_items":4,"no_references":1,"dynamic_archive":false},"metadata":{"archive_id":"4232cb61-dea1-4aec-b112-31c47f3b933c","archive_name":"nand_true.0.10"}},"job_archive_info":{"type_name":"4232cb61-dea1-4aec-b112-31c47f3b933c","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"archive_id":"4232cb61-dea1-4aec-b112-31c47f3b933c","archive_alias":"nand_true.0.10","archive_type_info":{"type_name":"sqlite_job_archive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[{"name":"Markus Binsteiner","email":"markus@frkl.io"}]},"context":{"references":{"source_repo":{"url":"https://github.com/DHARPA-Project/kiara","desc":"The kiara project git repository."},"documentation":{"url":"https://dharpa.org/kiara_documentation/","desc":"The url for kiara documentation."}},"tags":[],"labels":{"package":"kiara"}},"python_class":{"python_class_name":"SqliteJobArchive","python_module_name":"kiara.registries.jobs.job_store.sqlite_store","full_name":"kiara.registries.jobs.job_store.sqlite_store.SqliteJobArchive"},"is_writable":false,"supported_item_types":["job_record"]},"config":{"sqlite_db_path":"/home/markus/projects/kiara/kiara/tests/resources/archives/nand_true.0.10.kiarchive","use_wal_mode":false},"details":{"no_job_records":4,"dynamic_archive":false},"metadata":{"archive_id":"4232cb61-dea1-4aec-b112-31c47f3b933c","archive_name":"nand_true.0.10"}}} \ No newline at end of file +{"type_name":"nand_true.0.10.kiarchive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"data_archive_info":{"type_name":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"archive_id":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","archive_alias":"nand_true.0.10","archive_type_info":{"type_name":"sqlite_data_archive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[{"name":"Markus Binsteiner","email":"markus@frkl.io"}]},"context":{"references":{"source_repo":{"url":"https://github.com/DHARPA-Project/kiara","desc":"The kiara project git repository."},"documentation":{"url":"https://dharpa.org/kiara_documentation/","desc":"The url for kiara documentation."}},"tags":[],"labels":{"package":"kiara"}},"python_class":{"python_class_name":"SqliteDataArchive","python_module_name":"kiara.registries.data.data_store.sqlite_store","full_name":"kiara.registries.data.data_store.sqlite_store.SqliteDataArchive"},"is_writable":false,"supported_item_types":["data"]},"config":{"sqlite_db_path":"/home/markus/projects/kiara/kiara/tests/resources/archives/nand_true.0.10.kiarchive","use_wal_mode":false},"details":{"no_values":6,"value_ids":["02f09f4f-d79d-4a02-8e33-6eafc41804b1","8009efad-0aa0-4bac-8c53-083914778a94","b0e7db2d-7d94-43c5-a93d-ad28f912e67f","b10f8c8c-bd08-40e1-84b2-d1e9091f5289","c9bba191-bd10-4d1f-9752-b4e3da24f12f","edbd6711-0432-430f-a147-08a6ae9df220"],"dynamic_archive":false,"size":135168},"metadata":{"archive_id":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","archive_name":"nand_true.0.10"}},"alias_archive_info":{"type_name":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"archive_id":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","archive_alias":"nand_true.0.10","archive_type_info":{"type_name":"sqlite_alias_archive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[{"name":"Markus Binsteiner","email":"markus@frkl.io"}]},"context":{"references":{"source_repo":{"url":"https://github.com/DHARPA-Project/kiara","desc":"The kiara project git repository."},"documentation":{"url":"https://dharpa.org/kiara_documentation/","desc":"The url for kiara documentation."}},"tags":[],"labels":{"package":"kiara"}},"python_class":{"python_class_name":"SqliteAliasArchive","python_module_name":"kiara.registries.aliases.sqlite_store","full_name":"kiara.registries.aliases.sqlite_store.SqliteAliasArchive"},"is_writable":false,"supported_item_types":["alias"]},"config":{"sqlite_db_path":"/home/markus/projects/kiara/kiara/tests/resources/archives/nand_true.0.10.kiarchive","use_wal_mode":false},"details":{"no_aliases":1,"aliases":["y"],"dynamic_archive":false},"metadata":{"archive_id":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","archive_name":"nand_true.0.10"}},"metadata_archive_info":{"type_name":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"archive_id":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","archive_alias":"nand_true.0.10","archive_type_info":{"type_name":"sqlite_metadata_archive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[{"name":"Markus Binsteiner","email":"markus@frkl.io"}]},"context":{"references":{"source_repo":{"url":"https://github.com/DHARPA-Project/kiara","desc":"The kiara project git repository."},"documentation":{"url":"https://dharpa.org/kiara_documentation/","desc":"The url for kiara documentation."}},"tags":[],"labels":{"package":"kiara"}},"python_class":{"python_class_name":"SqliteMetadataArchive","python_module_name":"kiara.registries.metadata.metadata_store.sqlite_store","full_name":"kiara.registries.metadata.metadata_store.sqlite_store.SqliteMetadataArchive"},"is_writable":false,"supported_item_types":["metadata"]},"config":{"sqlite_db_path":"/home/markus/projects/kiara/kiara/tests/resources/archives/nand_true.0.10.kiarchive","use_wal_mode":false},"details":{"no_metadata_items":4,"no_references":1,"dynamic_archive":false},"metadata":{"archive_id":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","archive_name":"nand_true.0.10"}},"job_archive_info":{"type_name":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[]},"context":{"references":{},"tags":[],"labels":{}},"archive_id":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","archive_alias":"nand_true.0.10","archive_type_info":{"type_name":"sqlite_job_archive","documentation":{"description":"-- n/a --","doc":null},"authors":{"authors":[{"name":"Markus Binsteiner","email":"markus@frkl.io"}]},"context":{"references":{"source_repo":{"url":"https://github.com/DHARPA-Project/kiara","desc":"The kiara project git repository."},"documentation":{"url":"https://dharpa.org/kiara_documentation/","desc":"The url for kiara documentation."}},"tags":[],"labels":{"package":"kiara"}},"python_class":{"python_class_name":"SqliteJobArchive","python_module_name":"kiara.registries.jobs.job_store.sqlite_store","full_name":"kiara.registries.jobs.job_store.sqlite_store.SqliteJobArchive"},"is_writable":false,"supported_item_types":["job_record"]},"config":{"sqlite_db_path":"/home/markus/projects/kiara/kiara/tests/resources/archives/nand_true.0.10.kiarchive","use_wal_mode":false},"details":{"no_job_records":4,"dynamic_archive":false},"metadata":{"archive_id":"2dd3e60a-da65-4c3e-ae41-a66f4aab0cba","archive_name":"nand_true.0.10"}}} \ No newline at end of file diff --git a/tests/test_archives/test_archive_import.py b/tests/test_archives/test_archive_import.py index 86d77914c..421d638ee 100644 --- a/tests/test_archives/test_archive_import.py +++ b/tests/test_archives/test_archive_import.py @@ -8,6 +8,8 @@ ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) TEST_RESOURCES_FOLDER = os.path.join(ROOT_DIR, "tests", "resources") +VALUE_ID = "edbd6711-0432-430f-a147-08a6ae9df220" + def test_archive_import_values_no_alias(api: BaseAPI): @@ -22,11 +24,11 @@ def test_archive_import_values_no_alias(api: BaseAPI): assert not result.errors assert len(result) == 6 - assert "b6bdc921-35d6-43e6-ba20-25e617b7e5ea" in result.keys() + assert VALUE_ID in result.keys() - assert uuid.UUID("b6bdc921-35d6-43e6-ba20-25e617b7e5ea") in api.list_all_value_ids() + assert uuid.UUID(VALUE_ID) in api.list_all_value_ids() - assert ["export_test#y"] == api.list_alias_names() + assert ["nand_true.0.10#y"] == api.list_alias_names() def test_archive_import_values_with_alias(api: BaseAPI): @@ -42,8 +44,8 @@ def test_archive_import_values_with_alias(api: BaseAPI): assert not result.errors assert len(result) == 6 - assert "b6bdc921-35d6-43e6-ba20-25e617b7e5ea" in result.keys() + assert VALUE_ID in result.keys() - assert uuid.UUID("b6bdc921-35d6-43e6-ba20-25e617b7e5ea") in api.list_all_value_ids() + assert uuid.UUID(VALUE_ID) in api.list_all_value_ids() - assert {"y", "export_test#y"} == set(api.list_alias_names()) + assert {"y", "nand_true.0.10#y"} == set(api.list_alias_names())