Right now in Robyn, you need to make a network request(using the requests library). Adding a test client will essentially avoid the need to that, making the responses much faster!
Sample usage
from robyn.testing import TestClient
from myapp import app
client = TestClient(app)
def test_index():
response = client.get("/")
assert response.status_code == 200
assert response.text == "Hello, Robyn!"
def test_upload():
file_data = b"This is a test file"
response = client.post("/upload", files={"file": ("test_file.txt", file_data)})
assert response.status_code == 200
assert response.json() == {"message": "File uploaded successfully"}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too