MCPcopy Create free account
hub / github.com/sammchardy/python-binance / test_invalid_json

Function test_invalid_json

tests/test_api_request.py:17–30  ·  view source on GitHub ↗

Test Invalid response Exception

()

Source from the content-addressed store, hash-verified

15
16
17def test_invalid_json():
18 """Test Invalid response Exception"""
19
20 with pytest.raises(BinanceRequestException):
21 with requests_mock.mock() as m:
22 m.get(
23 "https://www.binance.com/exchange-api/v1/public/asset-service/product/get-products?includeEtf=true",
24 text="<head></html>",
25 )
26 m.get(
27 "https://www.binance.com/bapi/asset/v2/public/asset-service/product/get-products?includeEtf=true",
28 text="<head></html>",
29 )
30 client.get_products()
31
32
33def test_api_exception():

Callers

nothing calls this directly

Calls 1

get_productsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…