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

Function test_post_headers_async

tests/test_headers.py:44–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42
43@pytest.mark.asyncio()
44async def test_post_headers_async():
45 clientAsync = AsyncClient(
46 api_key="api_key", api_secret="api_secret"
47 ) # reuse client later
48 with aioresponses() as m:
49
50 def handler(url, **kwargs):
51 headers = kwargs["headers"]
52 assert "Content-Type" in headers
53 assert headers["Content-Type"] == "application/x-www-form-urlencoded"
54
55 m.post(
56 "https://api.binance.com/api/v3/order",
57 payload={"id": 1},
58 status=200,
59 callback=handler,
60 )
61 await clientAsync.create_order(
62 symbol="LTCUSDT", side="BUY", type="MARKET", quantity=0.1
63 )
64 await clientAsync.close_connection()
65
66
67@pytest.mark.asyncio()

Callers

nothing calls this directly

Calls 3

create_orderMethod · 0.95
close_connectionMethod · 0.95
AsyncClientClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…