def test_should_get_by_scopus(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/get_catalog_by_identifier/get_by_scopus.yaml'): doc = session.catalog.by_identifier(scopus='2-s2.0-41249100408') assert_core_view(doc)
def test_should_get_by_doi(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/get_catalog_by_identifier/get_by_doi.yaml'): doc = session.catalog.by_identifier(doi='10.1371/journal.pone.0000908') assert_core_view(doc)
def test_should_get_core_view(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/get_catalog_by_id/get_core_view.yaml'): doc = session.catalog.get('5cd8328e-febe-3299-8e26-cf6ab2c07f0f') assert_core_view(doc)
def test_should_lookup_by_doi(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/lookup/lookup_by_doi.yaml'): doc = session.catalog.lookup(doi='10.1371/journal.pone.0000908') assert doc.score == 100 assert_core_view(doc)
def test_should_lookup_by_filehash(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/lookup/lookup_by_filehash.yaml'): doc = session.catalog.lookup(filehash='f9d3777596893362bbf49618e758d6b8a5271d04') assert doc.score == 100 assert_core_view(doc)
def test_should_lookup_by_filehash(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/lookup/lookup_by_filehash.yaml'): doc = session.catalog.lookup( filehash='f9d3777596893362bbf49618e758d6b8a5271d04') assert doc.score == 100 assert_core_view(doc)
def test_should_get_by_doi(): session = get_client_credentials_session() with cassette( 'fixtures/resources/catalog/get_catalog_by_identifier/get_by_doi.yaml' ): doc = session.catalog.by_identifier(doi='10.1371/journal.pone.0000908') assert_core_view(doc)
def test_should_get_by_scopus(): session = get_client_credentials_session() with cassette( 'fixtures/resources/catalog/get_catalog_by_identifier/get_by_scopus.yaml' ): doc = session.catalog.by_identifier(scopus='2-s2.0-41249100408') assert_core_view(doc)
def test_should_lookup_by_metadata(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/lookup/lookup_by_metadata.yaml'): doc = session.catalog.lookup( title= 'Changes in tree reproductive traits reduce functional diversity in a fragmented ' 'Atlantic forest landscape', year=2007, source='PLoS ONE') assert doc.score == 91 assert_core_view(doc)
def test_should_raise_on_not_found(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/lookup/not_found.yaml'), \ pytest.raises(MendeleyApiException) as ex_info: doc = session.catalog.lookup(title='Underwater basket weaving', authors='Piers Bursill-Hall') assert doc.score == 91 assert_core_view(doc) ex = ex_info.value assert ex.status == 404
def test_should_lookup_by_metadata(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/lookup/lookup_by_metadata.yaml'): doc = session.catalog.lookup( title='Changes in tree reproductive traits reduce functional diversity in a fragmented ' 'Atlantic forest landscape', year=2007, source='PLoS ONE' ) assert doc.score == 91 assert_core_view(doc)
def test_should_raise_on_not_found(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/lookup/not_found.yaml'), \ pytest.raises(MendeleyApiException) as ex_info: doc = session.catalog.lookup( title='Underwater basket weaving', authors='Piers Bursill-Hall' ) assert doc.score == 91 assert_core_view(doc) ex = ex_info.value assert ex.status == 404