def test_match_by_arxiv_id_without_result(self, mock_get_arxiv_id_from_record): """Empty match_by_arxiv_id_results are handled correctly.""" from inspirehep.modules.workflows.tasks.matching import match_by_arxiv_id record = Record({}) result = match_by_arxiv_id(record) self.assertEqual(result, [])
def test_match_by_arxiv_id_with_result(self, search): """Good match_by_arxiv_id results are handled correctly.""" from inspirehep.modules.workflows.tasks.matching import match_by_arxiv_id record = Record({'arxiv_id': 'arXiv:1505.12345'}) result = match_by_arxiv_id(record) self.assertTrue(result)
def test_match_by_arxiv_eprints_with_result(self, search): """Can also match on the arxiv_eprints.value key.""" from inspirehep.modules.workflows.tasks.matching import match_by_arxiv_id record = Record({ 'arxiv_eprints': [ { 'value': 'arXiv:1505.12345', 'source': 'arXiv', } ] }) result = match_by_arxiv_id(record) self.assertTrue(result)