diff --git a/rero_mef/cli.py b/rero_mef/cli.py index 292f0f61..9ac6701c 100644 --- a/rero_mef/cli.py +++ b/rero_mef/cli.py @@ -540,7 +540,7 @@ def ordert_data(data): f' new:\t{json.dumps(data, sort_keys=True)}') if output: file_diff.write(data) - del(compaire_data[pid]) + del compaire_data[pid] else: if verbose: click.echo(f'NEW :\t{json.dumps(data, sort_keys=True)}') diff --git a/rero_mef/marctojson/do_idref_agent.py b/rero_mef/marctojson/do_idref_agent.py index 20e1a8b6..2a4d05c0 100644 --- a/rero_mef/marctojson/do_idref_agent.py +++ b/rero_mef/marctojson/do_idref_agent.py @@ -315,8 +315,8 @@ def trans_idref_preferred_name(self): tag_grouping = [ { 'subtags': 'c', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ', ' } @@ -354,15 +354,15 @@ def trans_idref_authorized_access_point(self): tag_grouping = [ { 'subtags': 'c', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ', ' }, { 'subtags': 'def', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ' ; ' } @@ -402,8 +402,8 @@ def trans_idref_variant_name(self): tag_grouping = [ { 'subtags': 'c', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ', ' } @@ -434,15 +434,15 @@ def trans_idref_variant_access_point(self): tag_grouping = [ { 'subtags': 'c', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ', ' }, { 'subtags': 'def', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ' ; ' } @@ -466,15 +466,15 @@ def trans_idref_parallel_access_point(self): tag_grouping = [ { 'subtags': 'c', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ', ' }, { 'subtags': 'def', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ' ; ' } diff --git a/rero_mef/utils.py b/rero_mef/utils.py index cd195a43..99d09dc9 100644 --- a/rero_mef/utils.py +++ b/rero_mef/utils.py @@ -1019,7 +1019,7 @@ def write_link_json( agent_pid = viaf_pid add_schema(json_dump, 'viaf') json_dump['pid'] = agent_pid - del(json_dump['viaf_pid']) + del json_dump['viaf_pid'] # only save VIAF data with used pids write_to_file = write_to_file_viaf if agent == 'viaf' else True if write_to_file: diff --git a/tests/unit/agents/test_agent_idref_transformation.py b/tests/unit/agents/test_agent_idref_transformation.py index a06a15bb..26ce308d 100644 --- a/tests/unit/agents/test_agent_idref_transformation.py +++ b/tests/unit/agents/test_agent_idref_transformation.py @@ -633,7 +633,7 @@ def test_idref_parallel_access_point(): trans = trans_prep('idref', xml_part_to_add) trans.trans_idref_parallel_access_point() assert trans.json == { - 'parallel_access_point': ['Paul. VI ( pape ) ( 1897-1978 )'] + 'parallel_access_point': ['Paul. VI (pape) (1897-1978)'] } diff --git a/tests/unit/agents/test_idref_contributions_person.py b/tests/unit/agents/test_idref_contributions_person.py index 1ed83e88..e42d6802 100644 --- a/tests/unit/agents/test_idref_contributions_person.py +++ b/tests/unit/agents/test_idref_contributions_person.py @@ -505,8 +505,8 @@ def test_idref_authorized_access_point(): trans = trans_prep('idref', xml_part_to_add) trans.trans_idref_authorized_access_point() assert trans.json == { - 'authorized_access_point': 'Stift Alter Dom Sankt Pauli ( Münster in ' - 'Westfalen, Allemagne )', + 'authorized_access_point': 'Stift Alter Dom Sankt Pauli (Münster in ' + 'Westfalen, Allemagne)', 'bf:Agent': 'bf:Organisation', 'conference': False, } @@ -521,8 +521,8 @@ def test_idref_authorized_access_point(): trans = trans_prep('idref', xml_part_to_add) trans.trans_idref_authorized_access_point() assert trans.json == { - 'authorized_access_point': 'Stift Alter Dom Sankt Pauli ( Münster in ' - 'Westfalen, Allemagne )', + 'authorized_access_point': 'Stift Alter Dom Sankt Pauli (Münster in ' + 'Westfalen, Allemagne)', 'bf:Agent': 'bf:Organisation', 'conference': True, } diff --git a/tests/unit/test_marctojson_helper.py b/tests/unit/test_marctojson_helper.py index bc9e23e7..0a1167b7 100644 --- a/tests/unit/test_marctojson_helper.py +++ b/tests/unit/test_marctojson_helper.py @@ -63,15 +63,15 @@ def test_build_string_list_from_fields(): tag_grouping=[ { 'subtags': 'c', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': ', ' }, { 'subtags': 'def', - 'start': ' ( ', - 'end': ' )', + 'start': ' (', + 'end': ')', 'delimiter': '', 'subdelimiter': '; ' } @@ -80,6 +80,6 @@ def test_build_string_list_from_fields(): assert data == [ 'Place of public./distr.' '. Address/publisher/dist.' - ' ( Name of publisher/dist. )' - ' ( Date; Place; Address )' + ' (Name of publisher/dist.)' + ' (Date; Place; Address)' ]