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

Function test_api_exception

tests/test_api_request.py:33–40  ·  view source on GitHub ↗

Test API response Exception

()

Source from the content-addressed store, hash-verified

31
32
33def test_api_exception():
34 """Test API response Exception"""
35
36 with pytest.raises(BinanceAPIException):
37 with requests_mock.mock() as m:
38 json_obj = {"code": 1002, "msg": "Invalid API call"}
39 m.get("https://api.binance.com/api/v3/time", json=json_obj, status_code=400)
40 client.get_server_time()
41
42
43def test_api_exception_invalid_json():

Callers

nothing calls this directly

Calls 1

get_server_timeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…