Skip to content

Commit

Permalink
Merge pull request #15 from ammirate/schema_validation
Browse files Browse the repository at this point in the history
tests: introduced schema validation in unit tests
  • Loading branch information
ammirate authored Aug 4, 2017
2 parents e24942d + 3760226 commit 8029677
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 270 deletions.
2 changes: 1 addition & 1 deletion inspire_json_merger/comparators.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ class Ret(PrimaryKeyComparator):
'references.reference.authors': AuthorComparator,
'report_numbers': ValueComparator,
'title_translations': LanguageComparator,
'titles': LanguageComparator
'titles': TitleComparator
}
2 changes: 1 addition & 1 deletion inspire_json_merger/merger_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class ArxivToArxivOperations(MergerConfigurationOperations):
'texkeys': UnifierOps.KEEP_ONLY_HEAD_ENTITIES,
'thesis_info.institutions': UnifierOps.KEEP_ONLY_UPDATE_ENTITIES,
'title_translations': UnifierOps.KEEP_ONLY_HEAD_ENTITIES,
'titles': UnifierOps.KEEP_UPDATE_AND_HEAD_ENTITIES_HEAD_FIRST,
'titles': UnifierOps.KEEP_UPDATE_AND_HEAD_ENTITIES_UPDATE_FIRST,
'urls': UnifierOps.KEEP_UPDATE_AND_HEAD_ENTITIES_HEAD_FIRST
}
list_dict_ops = {
Expand Down
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# This file is part of Inspire.
# Copyright (C) 2017 CERN.
#
# Invenio is free software; you can redistribute it
# Inspire is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# Inspire is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# along with Inspire; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
Expand Down Expand Up @@ -66,6 +66,8 @@
'munkres>=1.0.7',
'Unidecode>=0.4.19',
'autosemver',

'inspire-schemas~=45.0,>=45.0.1',
]

packages = find_packages()
Expand All @@ -75,7 +77,7 @@
name='inspire-json-merger',
description=__doc__,
long_description=readme + '\n\n' + history,
keywords='invenio TODO',
keywords='Inspire TODO',
license='GPLv2',
author='CERN',
author_email='admin@inspirehep.net',
Expand Down
9 changes: 4 additions & 5 deletions tests/fixtures/arxiv2arxiv/expected_merged.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,12 @@
}
],
"titles":[
{
"source":"arXiv",
"title":"Analyticity of the Ising curation: An interpretation"
},
{
"source":"arXiv",
"title":"Test Update to Analyticity of the Ising susceptibility: An interpretation"
}, {
"source":"arXiv",
"title":"Analyticity of the Ising curation: An interpretation"
}
]
}
}
Loading

0 comments on commit 8029677

Please sign in to comment.