Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_api_method_errors(logged_in_client):
request = apimethod.APIMethod(logged_in_client, 'method', 'params', 'exchange')
with pytest.raises(BetfairError):
request()
request = apimethod.BettingRequest(logged_in_client, 'method', 'params', 'exchange')
with pytest.raises(BetfairError):
request()
request = apimethod.OrderRequest(logged_in_client, 'method', 'params', 'exchange')
with pytest.raises(BetfairError):
request()
request = apimethod.BettingRequest(logged_in_client, 'method', 'params', 'exchange')
with pytest.raises(BetfairError):
request()
request = apimethod.AccountRequest(logged_in_client, 'method', 'params', 'exchange')
with pytest.raises(BetfairError):
request()
request = apimethod.ScoresRequest(logged_in_client, 'method', 'params', 'exchange')
with pytest.raises(BetfairError):
request()
request = apimethod.NavigationRequest(logged_in_client, 'method', 'params', 'UK')
with pytest.raises(BetfairError):
def list_competitions(api, params=None, session=None, exchange=None):
request = BettingRequest(api, 'SportsAPING/v1.0/listCompetitions', params, exchange)
(response, raw_response, sent) = request(session)
return process_response(response, raw_response, sent, apiparsedata.CompetitionResult)
def list_market_book(api, params=None, session=None, exchange=None):
request = BettingRequest(api, 'SportsAPING/v1.0/listMarketBook', params, exchange)
(response, raw_response, sent) = request(session)
return process_response(response, raw_response, sent, apiparsedata.MarketBook)
def list_market_catalogue(api, params=None, session=None, exchange=None):
request = BettingRequest(api, 'SportsAPING/v1.0/listMarketCatalogue', params, exchange)
(response, raw_response, sent) = request(session)
return process_response(response, raw_response, sent, apiparsedata.MarketCatalogue)
def list_venues(api, params=None, session=None, exchange=None):
request = BettingRequest(api, 'SportsAPING/v1.0/listVenues', params, exchange)
(response, raw_response, sent) = request(session)
return process_response(response, raw_response, sent, apiparsedata.VenueResult)
def list_current_orders(api, params=None, session=None, exchange=None):
request = BettingRequest(api, 'SportsAPING/v1.0/listCurrentOrders', params, exchange)
(response, raw_response, sent) = request(session)
return process_response(response, raw_response, sent, apiparsedata.CurrentOrders)
def list_event_types(api, params=None, session=None, exchange=None):
request = BettingRequest(api, 'SportsAPING/v1.0/listEventTypes', params, exchange)
(response, raw_response, sent) = request(session)
return process_response(response, raw_response, sent, apiparsedata.EventTypeResult)
def list_events(api, params=None, session=None, exchange=None):
request = BettingRequest(api, 'SportsAPING/v1.0/listEvents', params, exchange)
(response, raw_response, sent) = request(session)
return process_response(response, raw_response, sent, apiparsedata.EventResult)
def list_market_types(api, params=None, session=None, exchange=None):
request = BettingRequest(api, 'SportsAPING/v1.0/listMarketTypes', params, exchange)
(response, raw_response, sent) = request(session)
return process_response(response, raw_response, sent, apiparsedata.MarketTypeResult)