Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for empty (0.16 sec)

  1. tests/test_empty_router.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    router = APIRouter()
    
    
    @router.get("")
    def get_empty():
        return ["OK"]
    
    
    app.include_router(router, prefix="/prefix")
    
    
    client = TestClient(app)
    
    
    def test_use_empty():
        with client:
            response = client.get("/prefix")
            assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 22:37:34 GMT 2023
    - 805 bytes
    - Viewed (0)
  2. tests/test_reponse_set_reponse_code_empty.py

    Sebastián Ramírez <******@****.***> 1688149516 +0200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_events/test_tutorial003.py

        assert not ml_models, "ml_models should be empty"
        with TestClient(app) as client:
            assert ml_models["answer_to_everything"] == fake_answer_to_everything_ml_model
            response = client.get("/predict", params={"x": 2})
            assert response.status_code == 200, response.text
            assert response.json() == {"result": 84.0}
        assert not ml_models, "ml_models should be empty"
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_body_multiple_params/test_tutorial003.py

                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                ]
            }
        )
    
    
    def test_post_body_empty_list(client: TestClient):
        response = client.put("/items/5", json=[])
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py

                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                ]
            }
        )
    
    
    def test_post_body_empty_list(client: TestClient):
        response = client.put("/items/5", json=[])
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py

                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                ]
            }
        )
    
    
    @needs_py310
    def test_post_body_empty_list(client: TestClient):
        response = client.put("/items/5", json=[])
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  7. fastapi/dependencies/utils.py

    
    def get_typed_return_annotation(call: Callable[..., Any]) -> Any:
        signature = inspect.signature(call)
        annotation = signature.return_annotation
    
        if annotation is inspect.Signature.empty:
            return None
    
        globalns = getattr(call, "__globals__", {})
        return get_typed_annotation(annotation, globalns)
    
    
    def get_dependant(
        *,
        path: str,
        call: Callable[..., Any],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  8. tests/test_query.py

    
    def test_query_list_empty():
        response = client.get("/query/list/")
        assert response.status_code == 422
    
    
    def test_query_list_default():
        response = client.get("/query/list-default/?device_ids=1&device_ids=2")
        assert response.status_code == 200
        assert response.json() == [1, 2]
    
    
    def test_query_list_default_empty():
        response = client.get("/query/list-default/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  9. ci/official/containers/linux_arm64/devel.usertools/squash_testlogs.py

      source_file = re.search(
          r"/(bazel_pip|tensorflow)/.*", f.decode("utf-8")
      ).group(0)
      for testsuite in r:
        testsuite._elem.set("source_file", source_file)
        # Remove empty testcases
        for p in testsuite._elem.xpath(".//testcase"):
          if not len(p):  # pylint: disable=g-explicit-length-test
            testsuite._elem.remove(p)
    Python
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Sep 18 19:00:37 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py

                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                ]
            }
        )
    
    
    @needs_py39
    def test_post_body_empty_list(client: TestClient):
        response = client.put("/items/5", json=[])
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top