Search Options

Results per page
Sort
Preferred Languages
Advance

Results 241 - 250 of 1,036 for AssertJ (0.19 sec)

  1. tests/test_tutorial/test_query_params_str_validations/test_tutorial014_an_py310.py

        response = client.get("/items?hidden_query=somevalue")
        assert response.status_code == 200, response.text
        assert response.json() == {"hidden_query": "somevalue"}
    
    
    @needs_py310
    def test_no_hidden_query(client: TestClient):
        response = client.get("/items")
        assert response.status_code == 200, response.text
        assert response.json() == {"hidden_query": "Not found"}
    
    
    @needs_py310
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial002_py39.py

        response = client.post("/items/", json={"name": "Foo"})
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Foo", "description": None}
    
    
    @needs_py39
    def test_read_items(client: TestClient) -> None:
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {
                "name": "Portal Gun",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 25 19:10:22 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_additional_status_codes/test_tutorial001_py310.py

        response = client.put("/items/foo", json={"name": "Wrestlers"})
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Wrestlers", "size": None}
    
    
    @needs_py310
    def test_create(client: TestClient):
        response = client.put("/items/red", json={"name": "Chillies"})
        assert response.status_code == 201, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 738 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_custom_response/test_tutorial006b.py

    def test_redirect_response_class():
        response = client.get("/fastapi", follow_redirects=False)
        assert response.status_code == 307
        assert response.headers["location"] == "https://fastapi.tiangolo.com"
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 899 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial001.py

    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_response_model/test_tutorial003_02.py

    
    def test_get_portal():
        response = client.get("/portal")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Here's your interdimensional portal."}
    
    
    def test_get_redirect():
        response = client.get("/portal", params={"teleport": True}, follow_redirects=False)
        assert response.status_code == 307, response.text
        assert response.headers["location"] == "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  7. docs_src/dependency_testing/tutorial001_an_py39.py

    def test_override_in_items():
        response = client.get("/items/")
        assert response.status_code == 200
        assert response.json() == {
            "message": "Hello Items!",
            "params": {"q": None, "skip": 5, "limit": 10},
        }
    
    
    def test_override_in_items_with_q():
        response = client.get("/items/?q=foo")
        assert response.status_code == 200
        assert response.json() == {
            "message": "Hello Items!",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  8. tests/test_multi_body_errors.py

        return {"item": item}
    
    
    client = TestClient(app)
    
    
    def test_put_correct_body():
        response = client.post("/items/", json=[{"name": "Foo", "age": 5}])
        assert response.status_code == 200, response.text
        assert response.json() == {
            "item": [
                {
                    "name": "Foo",
                    "age": IsOneOf(
                        5,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_extra_models/test_tutorial005.py

    client = TestClient(app)
    
    
    def test_get_items():
        response = client.get("/keyword-weights/")
        assert response.status_code == 200, response.text
        assert response.json() == {"foo": 2.3, "bar": 3.4}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  10. tests/test_additional_response_extra.py

    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == {"id": "foo"}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.2K bytes
    - Viewed (0)
Back to top