Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for test_post (0.03 sec)

  1. tests/test_tutorial/test_handling_errors/test_tutorial005.py

                    "input": "XL",
                }
            ],
            "body": {"title": "towel", "size": "XL"},
        }
    
    
    def test_post():
        data = {"title": "towel", "size": 5}
        response = client.post("/items/", json=data)
        assert response.status_code == 200, response.text
        assert response.json() == data
    
    
    def test_openapi_schema():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 3.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py

        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.extra_models.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_post(client: TestClient):
        response = client.post(
            "/user/",
            json={
                "username": "johndoe",
                "password": "secret",
                "email": "******@****.***",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 5.5K bytes
    - Viewed (0)
  3. tests/test_request_params/test_file/test_list.py

                    "input": None,
                }
            ]
        }
    
    
    @pytest.mark.parametrize(
        "path",
        [
            "/list-bytes",
            "/list-uploadfile",
        ],
    )
    def test_list(path: str):
        client = TestClient(app)
        response = client.post(path, files=[("p", b"hello"), ("p", b"world")])
        assert response.status_code == 200
        assert response.json() == {"file_size": [5, 5]}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11.2K bytes
    - Viewed (0)
  4. tests/test_request_params/test_query/test_list.py

    Sebastián Ramírez <******@****.***> 1766860294 -0800
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  5. tests/test_request_params/test_header/test_list.py

    Sebastián Ramírez <******@****.***> 1766860294 -0800
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11K bytes
    - Viewed (0)
  6. tests/test_request_params/test_body/test_list.py

    Sebastián Ramírez <******@****.***> 1766860294 -0800
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11.9K bytes
    - Viewed (0)
  7. tests/test_request_params/test_form/test_list.py

    Sebastián Ramírez <******@****.***> 1766860294 -0800
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11.7K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_encoder/test_tutorial001.py

        return module
    
    
    @pytest.fixture(name="client")
    def get_client(mod: ModuleType):
        client = TestClient(mod.app)
        return client
    
    
    def test_put(client: TestClient, mod: ModuleType):
        fake_db = mod.fake_db
    
        response = client.put(
            "/items/123",
            json={
                "title": "Foo",
                "timestamp": "2023-01-01T12:00:00",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_bigger_applications/test_main.py

        response = client.put("/items/foo", headers={"X-Token": "invalid"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_put(client: TestClient):
        response = client.put(
            "/items/plumbus?token=jessica", headers={"X-Token": "fake-super-secret-token"}
        )
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 21.3K bytes
    - Viewed (0)
Back to top