()
| 42 | |
| 43 | @pytest.mark.asyncio() |
| 44 | async 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() |
nothing calls this directly
no test coverage detected
searching dependent graphs…