-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add explicit test of v12 to v13 migration
- Loading branch information
1 parent
1548e12
commit 3568894
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
########################################################################### | ||
# Copyright (c), The AiiDA team. All rights reserved. # | ||
# This file is part of the AiiDA code. # | ||
# # | ||
# The code is hosted on GitHub at https://github.com/aiidateam/aiida-core # | ||
# For further information on the license, see the LICENSE.txt file # | ||
# For further information please visit http://www.aiida.net # | ||
########################################################################### | ||
"""Test archive file migration from export version 0.12 to 0.13""" | ||
from aiida.storage.sqlite_zip.migrations.legacy.v12_to_v13 import migrate_v12_to_v13 | ||
|
||
|
||
def test_migrate_v12_to_v13(core_archive, migrate_from_func): | ||
"""Test the data migration of transport entry point strings | ||
e.g. from local to core.local. | ||
""" | ||
|
||
# Migrate v0.12 to v0.13 | ||
_, data = migrate_from_func('export_0.12_simple.aiida', '0.12', '0.13', migrate_v12_to_v13, core_archive) | ||
|
||
for values in data.get('export_data', {}).get('Computer', {}).values(): | ||
if 'transport_type' in values: | ||
assert values['transport_type'] in [ | ||
'core.local', | ||
'core.ssh', | ||
], (f"encountered illegal transport entry point string `{values['transport_type']}`") |