Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_route_converters_int (0.09 sec)

  1. tests/test_starlette_urlconvertors.py

        return {"path": param}
    
    
    @app.get("/query/")
    def query_convertor(param: str = Query()):
        return {"query": param}
    
    
    client = TestClient(app)
    
    
    def test_route_converters_int():
        # Test integer conversion
        response = client.get("/int/5")
        assert response.status_code == 200, response.text
        assert response.json() == {"int": 5}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Nov 27 14:46:06 UTC 2022
    - 1.7K bytes
    - Viewed (0)
Back to top