chore: fix api-server tests

This commit is contained in:
Matthias 2024-08-03 18:29:16 +02:00
parent b3915ff8fd
commit 9eebe82b34

View File

@ -2148,35 +2148,41 @@ def test_api_exchanges(botclient):
response = rc.json() response = rc.json()
assert isinstance(response["exchanges"], list) assert isinstance(response["exchanges"], list)
assert len(response["exchanges"]) > 20 assert len(response["exchanges"]) > 20
okx = [x for x in response["exchanges"] if x["name"] == "okx"][0] okx = [x for x in response["exchanges"] if x["classname"] == "okx"][0]
assert okx == { assert okx == {
"name": "okx", "classname": "okx",
"name": "OKX",
"valid": True, "valid": True,
"supported": True, "supported": True,
"comment": "", "comment": "",
"dex": False, "dex": False,
"is_alias": False,
"trade_modes": [ "trade_modes": [
{"trading_mode": "spot", "margin_mode": ""}, {"trading_mode": "spot", "margin_mode": ""},
{"trading_mode": "futures", "margin_mode": "isolated"}, {"trading_mode": "futures", "margin_mode": "isolated"},
], ],
} }
mexc = [x for x in response["exchanges"] if x["name"] == "mexc"][0] mexc = [x for x in response["exchanges"] if x["classname"] == "mexc"][0]
assert mexc == { assert mexc == {
"name": "mexc", "classname": "mexc",
"name": "MEXC Global",
"valid": True, "valid": True,
"supported": False, "supported": False,
"dex": False, "dex": False,
"comment": "", "comment": "",
"is_alias": False,
"trade_modes": [{"trading_mode": "spot", "margin_mode": ""}], "trade_modes": [{"trading_mode": "spot", "margin_mode": ""}],
} }
waves = [x for x in response["exchanges"] if x["name"] == "wavesexchange"][0] waves = [x for x in response["exchanges"] if x["classname"] == "wavesexchange"][0]
assert waves == { assert waves == {
"name": "wavesexchange", "classname": "wavesexchange",
"name": "Waves.Exchange",
"valid": True, "valid": True,
"supported": False, "supported": False,
"dex": True, "dex": True,
"comment": ANY, "comment": ANY,
"is_alias": False,
"trade_modes": [{"trading_mode": "spot", "margin_mode": ""}], "trade_modes": [{"trading_mode": "spot", "margin_mode": ""}],
} }