Search Options

Results per page
Sort
Preferred Languages
Advance

Results 251 - 260 of 1,107 for asset1 (0.16 sec)

  1. tests/test_multi_query_errors.py

    client = TestClient(app)
    
    
    def test_multi_query():
        response = client.get("/items/?q=5&q=6")
        assert response.status_code == 200, response.text
        assert response.json() == {"q": [5, 6]}
    
    
    def test_multi_query_incorrect():
        response = client.get("/items/?q=five&q=six")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_extra_models/test_tutorial003.py

    def test_get_car():
        response = client.get("/items/item1")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "description": "All my friends drive a low rider",
            "type": "car",
        }
    
    
    def test_get_plane():
        response = client.get("/items/item2")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_query_params_str_validations/test_tutorial012_an_py39.py

        url = "/items/"
        response = client.get(url)
        assert response.status_code == 200, response.text
        assert response.json() == {"q": ["foo", "bar"]}
    
    
    @needs_py39
    def test_multi_query_values(client: TestClient):
        url = "/items/?q=baz&q=foobar"
        response = client.get(url)
        assert response.status_code == 200, response.text
        assert response.json() == {"q": ["baz", "foobar"]}
    
    
    @needs_py39
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_templates/test_tutorial001.py

        client = TestClient(app)
        response = client.get("/items/foo")
        assert response.status_code == 200, response.text
        assert (
            b'<h1><a href="http://testserver/items/foo">Item ID: foo</a></h1>'
            in response.content
        )
        response = client.get("/static/styles.css")
        assert response.status_code == 200, response.text
        assert b"color: green;" in response.content
        shutil.rmtree("./templates")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jan 11 22:25:37 UTC 2024
    - 910 bytes
    - Viewed (0)
  5. tests/test_response_model_sub_types.py

    
    def test_path_operations():
        response = client.get("/valid1")
        assert response.status_code == 200, response.text
        response = client.get("/valid2")
        assert response.status_code == 200, response.text
        response = client.get("/valid3")
        assert response.status_code == 200, response.text
        response = client.get("/valid4")
        assert response.status_code == 200, response.text
    
    
    def test_openapi_schema():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 5.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_files/test_tutorial001_03_an_py39.py

        assert response.status_code == 200, response.text
        assert response.json() == {"file_size": 14}
    
    
    @needs_py39
    def test_post_upload_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("/uploadfile/", files={"file": file})
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_body_fields/test_tutorial001_an.py

        client = TestClient(app)
        return client
    
    
    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},
        }
    
    
    def test_items_6(client: TestClient):
        response = client.put(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py

        client = TestClient(app)
        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):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_custom_response/test_tutorial004.py

        </html>
        """
    
    
    def test_get_custom_response():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.text == html_contents
    
    
    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)
  10. tests/test_tutorial/test_behind_a_proxy/test_tutorial004.py

    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello World", "root_path": "/api/v1"}
    
    
    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"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 1.6K bytes
    - Viewed (0)
Back to top