Skip to content

Commit

Permalink
chore: fix test archive
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Apr 8, 2024
1 parent b52acc4 commit fe4bc31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/resources/archives/nand_true.0.10.kiarchive.json
Original file line number Diff line number Diff line change
@@ -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"}}}
{"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"}}}
14 changes: 8 additions & 6 deletions tests/test_archives/test_archive_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand All @@ -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):
Expand All @@ -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())

0 comments on commit fe4bc31

Please sign in to comment.