You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "bito-code-review[bot] (via GitHub)" <gi...@apache.org> on 2026/05/14 12:17:34 UTC

Re: [PR] Miss [superset]

bito-code-review[bot] commented on PR #40117:
URL: https://github.com/apache/superset/pull/40117#issuecomment-4450577509

   <!-- Bito Reply -->
   The flagged issue is correct—the test defines and tests a local mock of `validate_user_access` instead of the production function, leading to false-positive tests. To resolve, import the actual production `validate_user_access` function and remove the local definition. Assuming it's in `superset.security`, here's the concise fix.
   
   **tests/unit_tests/security/test_user_access_validation.py**
   ```
   import pytest
   
   from superset.security import validate_user_access
   
   
   @pytest.mark.parametrize("password, expected", [
       ("12345", False),
       ("123456", True),
       ("a" * 255, True),
       ("a" * 256, False),
   ])
   def test_password_boundary_validation(password, expected):
       """
       Justificativa: Valida os limites exatos da especificação funcional.
       Técnica: AVL (Análise de Valor Limite).
       """
       assert validate_user_access(password, True, False) == expected
   
   
   def test_account_status_logic_coverage():
       password = "valid_password_123"
   
       assert validate_user_access(password, True, user_is_locked=True) is False
   
       assert validate_user_access(password, user_is_active=False, user_is_locked=False) is False
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org