Search Options

Results per page
Sort
Preferred Languages
Advance

Results 261 - 270 of 3,434 for getE (0.06 sec)

  1. tests/test_dependency_security_overrides.py

    def get_data_override():
        return [3, 4, 5]
    
    
    @app.get("/user")
    def read_user(
        user_data: Tuple[str, List[str]] = Security(get_user, scopes=["foo", "bar"]),
        data: List[int] = Depends(get_data),
    ):
        return {"user": user_data[0], "scopes": user_data[1], "data": data}
    
    
    client = TestClient(app)
    
    
    def test_normal():
        response = client.get("/user")
        assert response.json() == {
            "user": "john",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 14 15:54:46 UTC 2020
    - 1.4K bytes
    - Viewed (0)
  2. 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)
  3. tests/test_security_api_key_query.py

        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        return current_user
    
    
    client = TestClient(app)
    
    
    def test_security_api_key():
        response = client.get("/users/me?key=secret")
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  4. tests/test_security_http_base_description.py

    security = HTTPBase(scheme="Other", description="Other Security Scheme")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    def test_security_http_base():
        response = client.get("/users/me", headers={"Authorization": "Other foobar"})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial006_an_py39.py

    @needs_py39
    def test_security_http_basic(client: TestClient):
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "john", "password": "secret"}
    
    
    @needs_py39
    def test_security_http_basic_no_credentials(client: TestClient):
        response = client.get("/users/me")
        assert response.json() == {"detail": "Not authenticated"}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/cache/LocalCacheTest.java

        for (int i = 0; i < size; i++) {
          ReferenceEntry<K, V> expectedEntry = expectedEntries.get(i);
          ReferenceEntry<K, V> actualEntry = actualEntries.get(i);
          assertSame(expectedEntry.getKey(), actualEntry.getKey());
          assertSame(expectedEntry.getValueReference().get(), actualEntry.getValueReference().get());
        }
      }
    
      static <K, V> void checkExpirationTimes(LocalCache<K, V> map) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 110.6K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/cache/LocalCacheTest.java

        for (int i = 0; i < size; i++) {
          ReferenceEntry<K, V> expectedEntry = expectedEntries.get(i);
          ReferenceEntry<K, V> actualEntry = actualEntries.get(i);
          assertSame(expectedEntry.getKey(), actualEntry.getKey());
          assertSame(expectedEntry.getValueReference().get(), actualEntry.getValueReference().get());
        }
      }
    
      static <K, V> void checkExpirationTimes(LocalCache<K, V> map) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 112.3K bytes
    - Viewed (0)
  8. internal/config/drive/drive.go

    		MaxTimeout: 30 * time.Second,
    	}
    	if err = config.CheckValidKeys(config.DriveSubSys, kvs, DefaultKVS); err != nil {
    		return cfg, err
    	}
    
    	// if not set. Get default value from environment
    	d := env.Get(EnvMaxDriveTimeout, env.Get(EnvMaxDriveTimeoutLegacy, env.Get(EnvMaxDiskTimeoutLegacy, kvs.GetWithDefault(MaxTimeout, DefaultKVS))))
    	if d == "" {
    		cfg.MaxTimeout = 30 * time.Second
    	} else {
    		dur, _ := time.ParseDuration(d)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 3K bytes
    - Viewed (0)
  9. compat/maven-compat/src/test/java/org/apache/maven/artifact/transform/TransformationManagerTest.java

            assertTrue(
                    tms.get(0) instanceof ReleaseArtifactTransformation,
                    "We expected the release transformation and got " + tms.get(0));
    
            assertTrue(
                    tms.get(1) instanceof LatestArtifactTransformation,
                    "We expected the latest transformation and got " + tms.get(1));
    
            assertTrue(
                    tms.get(2) instanceof SnapshotTransformation,
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  10. docs_src/dependency_testing/tutorial001_py310.py

    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return {"message": "Hello Items!", "params": commons}
    
    
    @app.get("/users/")
    async def read_users(commons: 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.4K bytes
    - Viewed (0)
Back to top