Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for patrice (0.18 sec)

  1. tests/test_tutorial/test_dataclasses/test_tutorial001.py

        response = client.post("/items/", json={"name": "Foo", "price": 3})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 3,
            "description": None,
            "tax": None,
        }
    
    
    def test_post_invalid_item():
        response = client.post("/items/", json={"name": "Foo", "price": "invalid price"})
        assert response.status_code == 422
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_body_fields/test_tutorial001.py

        }
    
    
    def test_invalid_price(client: TestClient):
        response = client.put("/items/5", json={"item": {"name": "Foo", "price": -3.0}})
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "greater_than",
                        "loc": ["body", "item", "price"],
                        "msg": "Input should be greater than 0",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_body/test_tutorial001.py

        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (5)
  4. tests/test_tutorial/test_schema_extra_example/test_tutorial001.py

                            },
                            "price": {"type": "number", "title": "Price"},
                            "tax": {
                                "anyOf": [{"type": "number"}, {"type": "null"}],
                                "title": "Tax",
                            },
                        },
                        "type": "object",
                        "required": ["name", "price"],
                        "title": "Item",
    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)
  5. tests/test_tutorial/test_body_updates/test_tutorial001.py

            "name": "Baz",
            "description": None,
            "price": 50.2,
            "tax": 10.5,
            "tags": [],
        }
    
    
    def test_put(client: TestClient):
        response = client.put(
            "/items/bar", json={"name": "Barz", "price": 3, "description": None}
        )
        assert response.json() == {
            "name": "Barz",
            "description": None,
            "price": 3,
            "tax": 10.5,
            "tags": [],
        }
    
    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)
  6. tests/test_tutorial/test_body_multiple_params/test_tutorial001.py

    
    def test_post_body_q_bar_content(client: TestClient):
        response = client.put("/items/5?q=bar", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {
                "name": "Foo",
                "price": 50.5,
                "description": None,
                "tax": None,
            },
            "q": "bar",
        }
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
Back to top