Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for assertj (0.19 sec)

  1. tests/test_tutorial/test_body_updates/test_tutorial001_py310.py

        )
        assert response.json() == {
            "name": "Barz",
            "description": None,
            "price": 3,
            "tax": 10.5,
            "tags": [],
        }
    
    
    @needs_py310
    @needs_pydanticv2
    def test_openapi_schema(client: TestClient):
        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: 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

        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"})
        assert response.status_code == 201, response.text
    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

        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)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5}
    
    
    @needs_py310
    def test_post_id_foo(client: TestClient):
    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

        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/")
        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: Thu Sep 28 04:14:40 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_header_params/test_tutorial001_py310.py

        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):
        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 Jul 07 17:12:13 GMT 2023
    - 4K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_cookie_params/test_tutorial001_py310.py

        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    @needs_py310
    def test_openapi_schema():
        from docs_src.cookie_params.tutorial001_py310 import app
    
        client = TestClient(app)
        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 Jul 07 17:12:13 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_schema_extra_example/test_tutorial001_py310.py

                "price": 35.4,
                "tax": 3.2,
            },
        )
        assert response.status_code == 200
    
    
    @needs_py310
    @needs_pydanticv2
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        # insert_assert(response.json())
        assert response.json() == {
            "openapi": "3.1.0",
    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)
  8. tests/test_tutorial/test_body_fields/test_tutorial001_py310.py

        client = TestClient(app)
        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):
    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)
  9. tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py

            }
        )
        response = client.put(f"/items/{item_id}", json=data)
        assert response.status_code == 200, response.text
        assert response.json() == expected_response
    
    
    @needs_py310
    def test_openapi_schema(client: TestClient):
        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: Fri Apr 19 00:11:40 GMT 2024
    - 7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_body/test_tutorial001_py310.py

        )
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": "Some Foo",
            "tax": 0.3,
        }
    
    
    @needs_py310
    def test_post_with_only_name(client: TestClient):
        response = client.post("/items/", json={"name": "Foo"})
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
    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