Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 241 for Poulter (0.05 seconds)

  1. tests/test_include_route.py

    from fastapi.responses import JSONResponse
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    router = APIRouter()
    
    
    @router.route("/items/")
    def read_items(request: Request):
        return JSONResponse({"hello": "world"})
    
    
    app.include_router(router)
    
    client = TestClient(app)
    
    
    def test_sub_router():
        response = client.get("/items/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 496 bytes
    - Click Count (0)
  2. tests/test_router_redirect_slashes.py

    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    
    
    def test_redirect_slashes_enabled():
        app = FastAPI()
        router = APIRouter()
    
        @router.get("/hello/")
        def hello_page() -> str:
            return "Hello, World!"
    
        app.include_router(router)
    
        client = TestClient(app)
    
        response = client.get("/hello/", follow_redirects=False)
        assert response.status_code == 200
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Thu Jun 22 10:37:50 GMT 2023
    - 974 bytes
    - Click Count (0)
  3. docs/de/docs/tutorial/bigger-applications.md

    Wir importieren das Submodul `items` direkt, anstatt nur seine Variable `router` zu importieren.
    
    Das liegt daran, dass wir im Submodul `users` auch eine weitere Variable namens `router` haben.
    
    Wenn wir eine nach der anderen importiert hätten, etwa:
    
    ```Python
    from .routers.items import router
    from .routers.users import router
    ```
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 10 13:54:34 GMT 2025
    - 21.3K bytes
    - Click Count (0)
  4. guava-tests/test/com/google/common/io/MultiReaderTest.java

        String testString = "abcdefgh";
        CharSource source = newCharSource(testString);
        int[] counter = new int[1];
        CharSource reader =
            new CharSource() {
              @Override
              public Reader openStream() throws IOException {
                if (counter[0]++ != 0) {
                  throw new IllegalStateException("More than one source open");
                }
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue May 13 18:46:00 GMT 2025
    - 3.7K bytes
    - Click Count (0)
  5. src/cmd/addr2line/main.go

    	os.Exit(2)
    }
    
    func main() {
    	log.SetFlags(0)
    	log.SetPrefix("addr2line: ")
    	counter.Open()
    
    	// pprof expects this behavior when checking for addr2line
    	if len(os.Args) > 1 && os.Args[1] == "--help" {
    		printUsage(os.Stdout)
    		os.Exit(0)
    	}
    
    	flag.Usage = usage
    	flag.Parse()
    	counter.Inc("addr2line/invocations")
    	counter.CountFlags("addr2line/flag:", *flag.CommandLine)
    	if flag.NArg() != 1 {
    		usage()
    	}
    
    Created: Tue Dec 30 11:13:12 GMT 2025
    - Last Modified: Fri Jun 21 19:58:04 GMT 2024
    - 2.4K bytes
    - Click Count (0)
  6. docs_src/bigger_applications/app_py39/main.py

    from .internal import admin
    from .routers import items, users
    
    app = FastAPI(dependencies=[Depends(get_query_token)])
    
    
    app.include_router(users.router)
    app.include_router(items.router)
    app.include_router(
        admin.router,
        prefix="/admin",
        tags=["admin"],
        dependencies=[Depends(get_token_header)],
        responses={418: {"description": "I'm a teapot"}},
    )
    
    
    @app.get("/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 552 bytes
    - Click Count (0)
  7. scripts/contributors.py

    
    class ContributorsResults(BaseModel):
        contributors: Counter[str]
        translation_reviewers: Counter[str]
        translators: Counter[str]
        authors: dict[str, Author]
    
    
    def get_contributors(pr_nodes: list[PullRequestNode]) -> ContributorsResults:
        contributors = Counter[str]()
        translation_reviewers = Counter[str]()
        translators = Counter[str]()
        authors: dict[str, Author] = {}
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Dec 16 12:34:01 GMT 2025
    - 8.6K bytes
    - Click Count (0)
  8. docs_src/custom_request_and_route/tutorial003_py310.py

            return custom_route_handler
    
    
    app = FastAPI()
    router = APIRouter(route_class=TimedRoute)
    
    
    @app.get("/")
    async def not_timed():
        return {"message": "Not timed"}
    
    
    @router.get("/timed")
    async def timed():
        return {"message": "It's the time of my life"}
    
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 1K bytes
    - Click Count (0)
  9. tests/test_empty_router.py

    import pytest
    from fastapi import APIRouter, FastAPI
    from fastapi.exceptions import FastAPIError
    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")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sun Jun 11 22:37:34 GMT 2023
    - 805 bytes
    - Click Count (1)
  10. guava-tests/test/com/google/common/io/MultiInputStreamTest.java

      }
    
      public void testOnlyOneOpen() throws Exception {
        ByteSource source = newByteSource(0, 50);
        int[] counter = new int[1];
        ByteSource checker =
            new ByteSource() {
              @Override
              public InputStream openStream() throws IOException {
                if (counter[0]++ != 0) {
                  throw new IllegalStateException("More than one source open");
                }
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue Oct 28 18:44:53 GMT 2025
    - 4.7K bytes
    - Click Count (0)
Back to Top