Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 125 for fife (0.21 sec)

  1. tests/test_tutorial/test_request_files/test_tutorial001_03.py

    client = TestClient(app)
    
    
    def test_post_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        client = TestClient(app)
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"file_size": 14}
    
    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 6K bytes
    - Viewed (0)
  2. docs_src/request_files/tutorial001_02_py310.py

    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: bytes | None = File(default=None)):
        if not file:
            return {"message": "No file sent"}
        else:
            return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: UploadFile | None = None):
        if not file:
            return {"message": "No upload file sent"}
        else:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 470 bytes
    - Viewed (0)
  3. docs_src/request_forms_and_files/tutorial001_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, Form, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(
        file: Annotated[bytes, File()],
        fileb: Annotated[UploadFile, File()],
        token: Annotated[str, Form()],
    ):
        return {
            "file_size": len(file),
            "token": token,
            "fileb_content_type": fileb.content_type,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 386 bytes
    - Viewed (0)
  4. ci/official/containers/linux_arm64/devel.usertools/squash_testlogs.py

      p.text = runfiles_matcher.sub("[testroot]/", p.text)
      source_file = p.getparent().getparent().get("source_file", "")
      p.text += f"\nNOTE: From {source_file}"
      if "bazel_pip" in source_file:
        p.text += (
            "\nNOTE: This is a --config=pip test. Remove 'bazel_pip' to find"
            " the file."
        )
      n_failures = seen[key]
      p.text += f"\nNOTE: Number of failures for this test: {seen[key]}."
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Sep 18 19:00:37 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  5. ci/official/utilities/extract_resultstore_links.py

        testsuite.attrib = suite_attrib
        indent_xml(testsuites)
    
      tree = ElemTree.ElementTree(testsuites)
      file_path = os.path.join(output_path)
      with open(file_path, 'wb') as f:
        f.write(b'<?xml version="1.0"?>\n')
        tree.write(f)
        if verbose:
          print(f'\nWrote XML with Bazel invocation results to {file_path}')
    
    
    def print_invocation_results(result_store_dict: ResultDictType):
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Wed Nov 08 17:50:27 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_schema_extra_example/test_tutorial004_an_py310.py

                                                {
                                                    "name": "Baz",
                                                    "price": "thirty five point four",
                                                },
                                            ],
                                        }
                                    )
                                    | IsDict(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_background_tasks/test_tutorial002_an.py

    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.background_tasks.tutorial002_an import app
    
    client = TestClient(app)
    
    
    def test():
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 571 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_background_tasks/test_tutorial002_an_py310.py

    from ...utils import needs_py310
    
    
    @needs_py310
    def test():
        from docs_src.background_tasks.tutorial002_an_py310 import app
    
        client = TestClient(app)
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 631 bytes
    - Viewed (0)
  9. docs_src/schema_extra_example/tutorial004_an.py

                    },
                    {
                        "name": "Bar",
                        "price": "35.4",
                    },
                    {
                        "name": "Baz",
                        "price": "thirty five point four",
                    },
                ],
            ),
        ],
    ):
        results = {"item_id": item_id, "item": item}
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jul 01 16:43:29 GMT 2023
    - 965 bytes
    - Viewed (0)
  10. docs_src/schema_extra_example/tutorial004_an_py39.py

                    },
                    {
                        "name": "Bar",
                        "price": "35.4",
                    },
                    {
                        "name": "Baz",
                        "price": "thirty five point four",
                    },
                ],
            ),
        ],
    ):
        results = {"item_id": item_id, "item": item}
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jul 01 16:43:29 GMT 2023
    - 936 bytes
    - Viewed (0)
Back to top