swadhinbiswas docs: uv/uvx integration + heavy SEO (JSON-LD, keywords, FastAPI search visibility) · 7/24/2026
2550664
56 lines · 1.4 KB
Raw Download

title: Testing Client API
description: "API reference for the test client in JustAPI, the FastAPI alternative — in-process HTTP test client for testing routes without a server."
keywords: [testing client, fastapi alternative, justapi, test client, justapitestclient, integration testing]

JustAPITestClient

The test client sends HTTP requests to your application without starting a real server, using tokio duplex streams.

from justapi import JustAPITestClient

client = JustAPITestClient(app)

Methods

response = client.get("/items/42")
response = client.post("/items/", body={"name": "Item"})
response = client.put("/items/42", body={"name": "Updated"})
response = client.patch("/items/42", body={"name": "Patched"})
response = client.delete("/items/42")

Response Object

Attribute Type Description
status int HTTP status code
body bytes Raw response body
json() dict Parsed JSON body

Example Test

from justapi import JustAPIApp, JustAPITestClient

app = JustAPIApp()

@app.get("/ping")
def ping(request):
    return {"status": "ok"}

client = JustAPITestClient(app)
response = client.get("/ping")
assert response.status == 200
assert response.json() == {"status": "ok"}

See Also