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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to