Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for test_0 (0.23 sec)

  1. tests/test_tutorial/test_body_updates/test_tutorial001_py310.py

        return client
    
    
    @needs_py310
    def test_get(client: TestClient):
        response = client.get("/items/baz")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Baz",
            "description": None,
            "price": 50.2,
            "tax": 10.5,
            "tags": [],
        }
    
    
    @needs_py310
    def test_put(client: TestClient):
        response = client.put(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_additional_status_codes/test_tutorial001_py310.py

        client = TestClient(app)
        return client
    
    
    @needs_py310
    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_py310
    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
    - 738 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py

                "tax": None,
            },
            "q": "bar",
        }
    
    
    @needs_py310
    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_py310
    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)
  4. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial001_py310.py

        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_create_item(client: TestClient) -> None:
        response = client.post("/items/", json={"name": "Foo"})
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Foo", "description": None}
    
    
    @needs_py310
    def test_read_items(client: TestClient) -> None:
        response = client.get("/items/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body_fields/test_tutorial001_py310.py

        return client
    
    
    @needs_py310
    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_py310
    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)
  6. tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py

    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.extra_data_types.tutorial001_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    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)
  7. tests/test_tutorial/test_cookie_params/test_tutorial001_py310.py

        ],
    )
    def test(path, cookies, expected_status, expected_response):
        from docs_src.cookie_params.tutorial001_py310 import app
    
        client = TestClient(app, cookies=cookies)
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    @needs_py310
    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)
  8. tests/test_tutorial/test_header_params/test_tutorial001_py310.py

            ("/items", {"User-Agent": "FastAPI test"}, 200, {"User-Agent": "FastAPI test"}),
        ],
    )
    def test(path, headers, expected_status, expected_response, client: TestClient):
        response = client.get(path, headers=headers)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    @needs_py310
    def test_openapi_schema(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_schema_extra_example/test_tutorial001_py310.py

    
    @needs_py310
    @needs_pydanticv2
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
                "description": "A very nice Item",
                "price": 35.4,
                "tax": 3.2,
            },
        )
        assert response.status_code == 200
    
    
    @needs_py310
    @needs_pydanticv2
    def test_openapi_schema(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_body/test_tutorial001_py310.py

                    }
                ]
            }
        )
    
    
    @needs_py310
    def test_other_exceptions(client: TestClient):
        with patch("json.loads", side_effect=Exception):
            response = client.post("/items/", json={"test": "test2"})
            assert response.status_code == 400, response.text
    
    
    @needs_py310
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (1)
Back to top