Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for test_0 (0.2 sec)

  1. tests/test_tutorial/test_testing_dependencies/test_tutorial001_an_py39.py

    
    @needs_py39
    def test_override_in_items_run():
        from docs_src.dependency_testing.tutorial001_an_py39 import test_override_in_items
    
        test_override_in_items()
    
    
    @needs_py39
    def test_override_in_items_with_q_run():
        from docs_src.dependency_testing.tutorial001_an_py39 import (
            test_override_in_items_with_q,
        )
    
        test_override_in_items_with_q()
    
    
    @needs_py39
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_cookie_params/test_tutorial001_an_py39.py

        ],
    )
    def test(path, cookies, expected_status, expected_response):
        from docs_src.cookie_params.tutorial001_an_py39 import app
    
        client = TestClient(app, cookies=cookies)
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    @needs_py39
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py

                        "type": "value_error.missing",
                    },
                ]
            }
        )
    
    
    @needs_py39
    def test_post_files_and_token(tmp_path, app: FastAPI):
        patha = tmp_path / "test.txt"
        pathb = tmp_path / "testb.txt"
        patha.write_text("<file content>")
        pathb.write_text("<file b content>")
    
        client = TestClient(app)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py

        return client
    
    
    @needs_py39
    def test_items_5(client: TestClient):
        response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}})
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {"name": "Foo", "price": 3.0, "description": None, "tax": None},
        }
    
    
    @needs_py39
    def test_items_6(client: TestClient):
        response = client.put(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py

                "tax": None,
            },
            "q": "bar",
        }
    
    
    @needs_py39
    def test_post_no_body_q_bar(client: TestClient):
        response = client.put("/items/5?q=bar", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5, "q": "bar"}
    
    
    @needs_py39
    def test_post_no_body(client: TestClient):
        response = client.put("/items/5", json=None)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_additional_status_codes/test_tutorial001_an_py39.py

        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_update(client: TestClient):
        response = client.put("/items/foo", json={"name": "Wrestlers"})
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Wrestlers", "size": None}
    
    
    @needs_py39
    def test_create(client: TestClient):
        response = client.put("/items/red", json={"name": "Chillies"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 737 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_dependencies/test_tutorial001_an_py39.py

            ("/users", 200, {"q": None, "skip": 0, "limit": 100}),
        ],
    )
    def test_get(path, expected_status, expected_response, client: TestClient):
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    @needs_py39
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 7.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py

            }
        )
    
    
    @needs_py39
    def test_post_file(tmp_path, client: TestClient):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"file_size": 14}
    
    
    @needs_py39
    def test_post_large_file(tmp_path, client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py

        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
        assert response.json() == {"username": "Foo"}
    
    
    @needs_py39
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py

    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.extra_data_types.tutorial001_an_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_extra_types(client: TestClient):
        item_id = "ff97dd87-a4a5-4a12-b412-cde99f33e00e"
        data = {
            "start_datetime": "2018-12-22T14:00:00+00:00",
            "end_datetime": "2018-12-24T15:00:00+00:00",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 7K bytes
    - Viewed (0)
Back to top