How to use the habanero.exceptions.RequestError function in habanero

To help you get started, we’ve selected a few habanero examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sckott / habanero / test / test-types.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/types_query_title_not_allowed_anymore.yaml')
def test_types_query_title_not_allowed_anymore():
    "types - param: kwargs - query_title query not allowed anymore"
    res = cr.types(works = True, query_title = 'cellular')
github sckott / habanero / test / test-prefixes.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/prefixes_filters_not_allowed_with_dois.yaml')
def test_prefixes_query_filters_not_allowed_with_dois():
    "prefixes - param: kwargs - query filters not allowed on prefixes/prefix/ route"
    cr.prefixes(ids = "10.1371", query_editor = 'cooper')
github sckott / habanero / test / test-types.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/types_filters_not_allowed_with_typeid.yaml')
def test_types_query_filters_not_allowed_with_typeid():
    "types - param: kwargs - query filters not allowed on types/type/ route"
    cr.types(ids = "journal-article", query_bibliographic = 'gender')
github sckott / habanero / test / test-funders.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/funders_sample_err.yaml')
def test_funders_sample_err():
    "funders - param: sample - error b/c sample not supported"
    cr.funders(sample = 2)
github sckott / habanero / test / test-prefixes.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/prefixes_query_title_not_allowed_anymore.yaml')
def test_prefixes_query_title_not_allowed_anymore():
    "prefixes - param: kwargs - query_title query not allowed anymore"
    res = cr.prefixes(works = True, query_title = 'cellular')
github sckott / habanero / test / test-members.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/members_sample_err.yaml')
def test_members_sample_err():
    "members - param: sample - error b/c sample not supported"
    cr.members(sample = 2)
github sckott / habanero / test / test-members.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/members_filters_not_allowed_with_dois.yaml')
def test_members_query_filters_not_allowed_with_dois():
    "members - param: kwargs - query filters not allowed on works/memberid/ route"
    cr.members(ids = 98, query_author = 'carl boettiger')
github sckott / habanero / test / test-journals.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/journals_filter_fails_noidsworks.yaml')
def test_journals_filter_fails_noidsworks():
    "journals - filter fails, no ids or works"
    cr.journals(filter = {'from_pub_date': '2014-03-03'})
github sckott / habanero / test / test-funders.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/funders_filter_fails_noids.yaml')
def test_funders_filter_fails_noids():
    "funders - filter fails, no ids"
    cr.funders(works = True, filter = {'has_assertion': True})
github sckott / habanero / test / test-journals.py View on Github external
@raises(exceptions.RequestError)
@vcr.use_cassette('test/vcr_cassettes/journals_fail_offset.yaml')
def test_journals_fail_offset():
    "journals - fails on wrong input type to offset"
    cr.journals(offset = 'things')