def METHOD_NAME(core_archive, migrate_from_func):
    """Test the data migration of legacy `JobCalcState` attributes.
    This test has to use a local archive because the current archive from the `aiida-export-migration-tests`
    module does not include a `CalcJobNode` with a legacy `state` attribute.
    """
    # Get metadata.json and data.json as dicts from v0.5 file archive
    archive_path = get_archive_file('export_0.5_simple.aiida', **core_archive)
    metadata, data = read_json_files(archive_path)  # pylint: disable=unbalanced-tuple-unpacking
    verify_metadata_version(metadata, version='0.5')
    calc_job_node_type = 'process.calculation.calcjob.CalcJobNode.'
    node_data = data['export_data'].get('Node', {})
    node_attributes = data['node_attributes']
    calc_jobs = {}
    for pk, values in node_data.items():
        if values['node_type'] == calc_job_node_type and 'state' in data['node_attributes'].get(pk, {}):
            calc_jobs[pk] = data['node_attributes'][pk]['state']
    # Migrate to v0.6
    metadata, data = migrate_from_func('export_0.5_simple.aiida', '0.5', '0.6', migrate_v5_to_v6, core_archive)
    verify_metadata_version(metadata, version='0.6')
    node_attributes = data['node_attributes']
    # The export archive contains a single `CalcJobNode` that had `state=FINISHED`.
    for pk, state in calc_jobs.items():
        attributes = node_attributes[pk]
        if STATE_MAPPING[state].exit_status is not None:
            assert attributes['exit_status'] == STATE_MAPPING[state].exit_status
        if STATE_MAPPING[state].process_state is not None:
            assert attributes['process_state'] == STATE_MAPPING[state].process_state
        if STATE_MAPPING[state].process_status is not None:
            assert attributes['process_status'] == STATE_MAPPING[state].process_status
        assert attributes['process_label'] == 'Legacy JobCalculation'