예제 #1
0
def test_remote_openaire_loader_error(app):
    """Test the remote OAI-PMH OpenAIRE loader."""
    loader = RemoteOAIRELoader()
    with patch('invenio_openaire.loaders.etree.fromstring') as fs:
        fs.side_effect = FunderNotFoundError(1, 2, 3)
        records = list(loader.iter_grants())
        assert len(records) == 0
def test_remote_openaire_loader_error(app):
    """Test the remote OAI-PMH OpenAIRE loader."""
    loader = RemoteOAIRELoader()
    with patch('invenio_openaire.loaders.etree.fromstring') as fs:
        fs.side_effect = FunderNotFoundError(1, 2, 3)
        records = list(loader.iter_grants())
        assert len(records) == 0
예제 #3
0
def test_remote_openaire_loader(app, db):
    """Test the remote OAI-PMH OpenAIRE loader."""
    loader = RemoteOAIRELoader()
    pytest.raises(OAIRELoadingError, list, loader.iter_grants())

    recuuid = uuid.uuid4()
    PersistentIdentifier.create(
        'frdoi', '10.13039/501100000925',
        object_type='rec', object_uuid=recuuid, status='R')
    Record.create({'acronyms': ['EC']}, id_=recuuid)

    records = list(loader.iter_grants())
    assert len(records) == 5
예제 #4
0
def test_remote_openaire_loader(app, db):
    """Test the remote OAI-PMH OpenAIRE loader."""
    loader = RemoteOAIRELoader()
    pytest.raises(OAIRELoadingError, list, loader.iter_grants())

    recuuid = uuid.uuid4()
    PersistentIdentifier.create(
        'frdoi', '10.13039/501100000925',
        object_type='rec', object_uuid=recuuid, status='R')
    Record.create({'acronyms': ['EC']}, id_=recuuid)

    records = list(loader.iter_grants())
    assert len(records) == 5