Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 200 for me (0.13 sec)

  1. tests/test_security_http_base_optional.py

    client = TestClient(app)
    
    
    def test_security_http_base():
        response = client.get("/users/me", headers={"Authorization": "Other foobar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"scheme": "Other", "credentials": "foobar"}
    
    
    def test_security_http_base_no_credentials():
        response = client.get("/users/me")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/base/VerifyTest.java

          fail();
        } catch (VerifyException expected) {
          assertThat(expected).hasMessageThat().isEqualTo("message");
        }
      }
    
      public void testVerify_complexMessage_success() {
        verify(true, "%s", IGNORE_ME);
      }
    
      public void testVerify_complexMessage_failure() {
        try {
          verify(false, FORMAT, 5);
          fail();
        } catch (VerifyException expected) {
          checkMessage(expected);
        }
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu May 04 09:41:29 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  3. tests/test_security_api_key_query_optional.py

        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?key=secret")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
  4. 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"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial003.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
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8K bytes
    - Viewed (0)
  6. tests/test_security_api_key_cookie.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
    
    
    def test_security_api_key():
        client = TestClient(app, cookies={"key": "secret"})
        response = client.get("/users/me")
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "secret"}
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/ComparisonChainTest.java

                    .compare("a", "b")
                    .compare(DONT_COMPARE_ME, DONT_COMPARE_ME)
                    .result())
            .isLessThan(0);
      }
    
      public void testShortCircuitGreater() {
        assertThat(
                ComparisonChain.start()
                    .compare("b", "a")
                    .compare(DONT_COMPARE_ME, DONT_COMPARE_ME)
                    .result())
            .isGreaterThan(0);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 27 13:27:08 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  8. tests/test_security_api_key_header_optional.py

        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"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_security/test_tutorial003_an_py39.py

    @needs_py39
    def test_no_token(client: TestClient):
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py39
    def test_token(client: TestClient):
        response = client.get("/users/me", headers={"Authorization": "Bearer johndoe"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.4K bytes
    - Viewed (0)
  10. docs_src/security/tutorial002_py310.py

        )
    
    
    async def get_current_user(token: str = Depends(oauth2_scheme)):
        user = fake_decode_token(token)
        return user
    
    
    @app.get("/users/me")
    async def read_users_me(current_user: User = Depends(get_current_user)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 711 bytes
    - Viewed (0)
Back to top