fix: resolve 57 ruff lint errors (unused imports, unused variables, import placement)
CI / lint (push) Failing after 14s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / security (push) Successful in 11s

This commit is contained in:
2026-06-04 23:32:47 -04:00
parent 182e40800e
commit 3b53de1b33
14 changed files with 12 additions and 54 deletions
+1 -8
View File
@@ -1,7 +1,4 @@
# tests/test_auth.py — Tests for authentication and authorization
import os
import time
from unittest.mock import patch
import pytest
@@ -70,9 +67,7 @@ class TestJWTHandler:
from backend.auth.jwt_handler import (
create_access_token,
decode_token,
ACCESS_TOKEN_EXPIRE_SECONDS,
)
import time
# Override TTL to a value in the past
user = {"username": "testuser", "role": "user", "vaults": [], "display_name": "X"}
@@ -111,7 +106,6 @@ class TestJWTHandler:
def test_wrong_type_token(self):
"""decode_token rejects refresh tokens (type != 'access')."""
from backend.auth.jwt_handler import (
create_access_token,
create_refresh_token,
decode_token,
)
@@ -229,7 +223,7 @@ class TestUserStore:
class TestRateLimiter:
def test_initial_state(self):
from backend.ratelimit import is_rate_limited, get_status
from backend.ratelimit import get_status
status = get_status("192.168.1.1")
assert status["limited"] is False
assert status["failures"] == 0
@@ -268,7 +262,6 @@ class TestRateLimiter:
class TestMiddleware:
def test_is_auth_enabled_logic(self):
"""is_auth_enabled reads OBSIGATE_AUTH_ENABLED env var."""
import os
from backend.auth.middleware import is_auth_enabled
# The function checks if env var != 'false'
# In our test env it may be set by fixture — test the logic