(httpx_mock)
| 216 | |
| 217 | @pytest.mark.anyio |
| 218 | async def test_create_agent_posts_body(httpx_mock): |
| 219 | httpx_mock.add_response(status_code=201, json=_valid(AgentView, id="ag_new", email="new@test.dev")) |
| 220 | async with _client() as c: |
| 221 | res = await c.agents.create({"email": "new@test.dev"}) |
| 222 | assert res.id == "ag_new" |
| 223 | req = httpx_mock.get_requests()[-1] |
| 224 | assert req.method == "POST" |
| 225 | assert str(req.url).endswith("/v1/agents") |
| 226 | |
| 227 | |
| 228 | @pytest.mark.anyio |