Search Options

Results per page
Sort
Preferred Languages
Advance

Results 301 - 310 of 3,475 for getE (0.03 sec)

  1. tests/test_tutorial/test_dependencies/test_tutorial006.py

                ]
            }
        )
    
    
    def test_get_invalid_one_header():
        response = client.get("/items/", headers={"X-Token": "invalid"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_get_invalid_second_header():
        response = client.get(
            "/items/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"}
        )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 5K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http/RequestLine.kt

       * http://android.com/foo HTTP/1.1") or only the path (like "GET /foo HTTP/1.1").
       */
      private fun includeAuthorityInRequestLine(
        request: Request,
        proxyType: Proxy.Type,
      ): Boolean {
        return !request.isHttps && proxyType == Proxy.Type.HTTP
      }
    
      /**
       * Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, even if the request
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java

        assertThrows(CancellationException.class, () -> resultFuture.get());
      }
    
      public void testFutureGetThrowsCancellationIfOutputCancelled() throws Exception {
        inputFuture.set(SLOW_OUTPUT_VALID_INPUT_DATA);
        outputFuture.cancel(true); // argument is ignored
        assertThrows(CancellationException.class, () -> resultFuture.get());
      }
    
      public void testAsyncToString() throws Exception {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java

        assertThrows(CancellationException.class, () -> resultFuture.get());
      }
    
      public void testFutureGetThrowsCancellationIfOutputCancelled() throws Exception {
        inputFuture.set(SLOW_OUTPUT_VALID_INPUT_DATA);
        outputFuture.cancel(true); // argument is ignored
        assertThrows(CancellationException.class, () -> resultFuture.get());
      }
    
      public void testAsyncToString() throws Exception {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  5. tests/test_generic_parameterless_depends.py

    
    class A:
        pass
    
    
    class B:
        pass
    
    
    @app.get("/a")
    async def a(dep: Dep[A]):
        return {"cls": dep.__class__.__name__}
    
    
    @app.get("/b")
    async def b(dep: Dep[B]):
        return {"cls": dep.__class__.__name__}
    
    
    client = TestClient(app)
    
    
    def test_generic_parameterless_depends():
        response = client.get("/a")
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Apr 02 02:52:56 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_response_model/test_tutorial003_05_py310.py

    @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",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/portal": {
                    "get": {
                        "summary": "Get Portal",
                        "operationId": "get_portal_portal_get",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  7. tests/test_security_api_key_header_optional.py

        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: Optional[User] = Depends(get_current_user)):
        if current_user is None:
            return {"msg": "Create an account first"}
        return current_user
    
    
    client = TestClient(app)
    
    
    def test_security_api_key():
        response = client.get("/users/me", headers={"key": "secret"})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2K bytes
    - Viewed (0)
  8. docs_src/dependency_testing/tutorial001_an.py

        q: Union[str, None] = None, skip: int = 0, limit: int = 100
    ):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: Annotated[dict, Depends(common_parameters)]):
        return {"message": "Hello Items!", "params": commons}
    
    
    @app.get("/users/")
    async def read_users(commons: Annotated[dict, Depends(common_parameters)]):
        return {"message": "Hello Users!", "params": commons}
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_security/test_tutorial003_an.py

    
    def test_no_token():
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token():
        response = client.get("/users/me", headers={"Authorization": "Bearer johndoe"})
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8K bytes
    - Viewed (0)
  10. tests/test_exception_handlers.py

        }
    )
    
    client = TestClient(app)
    
    
    @app.get("/http-exception")
    def route_with_http_exception():
        raise HTTPException(status_code=400)
    
    
    @app.get("/request-validation/{param}/")
    def route_with_request_validation_exception(param: int):
        pass  # pragma: no cover
    
    
    @app.get("/server-error")
    def route_with_server_error():
        raise RuntimeError("Oops!")
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Feb 17 12:40:12 UTC 2022
    - 1.9K bytes
    - Viewed (0)
Back to top