Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for jeon (0.14 sec)

  1. tests/test_tutorial/test_additional_responses/test_tutorial002.py

        assert len(response.content)
        os.remove("./image.png")
    
    
    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"},
            "paths": {
                "/items/{item_id}": {
                    "get": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.6K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial002.py

        response = client.post("/items/", json={"name": "Foo"})
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Foo", "description": None}
    
    
    def test_read_items(client: TestClient) -> None:
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {
                "name": "Portal Gun",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_dataclasses/test_tutorial002.py

        assert response.json() == {
            "name": "Island In The Moon",
            "price": 12.99,
            "description": "A place to be be playin' and havin' fun",
            "tags": ["breater"],
            "tax": None,
        }
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200
        assert response.json() == {
            "openapi": "3.1.0",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_response_headers/test_tutorial002.py

    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/headers-and-object/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Hello World"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 378 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_header_params/test_tutorial002.py

        response = client.get(path, headers=headers)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/items/": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py

        ), "not used parameters should not be included"
        assert (
            '"syntaxHighlight.theme": "obsidian"' in response.text
        ), "parameters with middle dots should be included in a JSON compatible way"
        assert (
            '"dom_id": "#swagger-ui"' in response.text
        ), "default configs should be preserved"
        assert "presets: [" in response.text, "default configs should be preserved"
        assert (
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_files/test_tutorial002.py

                        "type": "value_error.missing",
                    }
                ]
            }
        )
    
    
    def test_post_body_json():
        response = client.post("/files/", json={"file": "Foo"})
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "files"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_handling_errors/test_tutorial002.py

        assert response.status_code == 200, response.text
        assert response.json() == {"item": "The Foo Wrestlers"}
    
    
    def test_get_item_not_found_header():
        response = client.get("/items-header/bar")
        assert response.status_code == 404, response.text
        assert response.headers.get("x-error") == "There goes my error"
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_events/test_tutorial002.py

            assert response.json() == [{"name": "Foo"}]
        with open("log.txt") as log:
            assert "Application shutdown" in log.read()
    
    
    def test_openapi_schema(app: FastAPI):
        with TestClient(app) as client:
            response = client.get("/openapi.json")
            assert response.status_code == 200, response.text
            assert response.json() == {
                "openapi": "3.1.0",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_background_tasks/test_tutorial002.py

        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Message sent"}
        with open("./log.txt") as f:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 568 bytes
    - Viewed (0)
Back to top