From 057c84fdc566ccc0568f1a4f42bb2f74c83c7197 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Wed, 3 Sep 2025 14:21:18 +0100 Subject: [PATCH] ruff check fix --- .../api/test_conditional_authentication_endpoints.py | 4 ++-- .../modules/users/test_conditional_authentication.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cognee/tests/unit/api/test_conditional_authentication_endpoints.py b/cognee/tests/unit/api/test_conditional_authentication_endpoints.py index 170887f07..bc9260cd3 100644 --- a/cognee/tests/unit/api/test_conditional_authentication_endpoints.py +++ b/cognee/tests/unit/api/test_conditional_authentication_endpoints.py @@ -156,7 +156,7 @@ class TestConditionalAuthenticationBehavior: error_detail = response.json().get("detail", "") assert "authenticate" not in error_detail.lower() assert "unauthorized" not in error_detail.lower() - except: + except Exception: pass # If response is not JSON, that's fine @patch("cognee.modules.settings.get_settings.get_vectordb_config") @@ -229,4 +229,4 @@ class TestConditionalAuthenticationErrorHandling: assert isinstance(REQUIRE_AUTHENTICATION, bool) # In default environment, should be False - assert REQUIRE_AUTHENTICATION == False + assert not REQUIRE_AUTHENTICATION diff --git a/cognee/tests/unit/modules/users/test_conditional_authentication.py b/cognee/tests/unit/modules/users/test_conditional_authentication.py index bca916f24..13e4a304d 100644 --- a/cognee/tests/unit/modules/users/test_conditional_authentication.py +++ b/cognee/tests/unit/modules/users/test_conditional_authentication.py @@ -126,7 +126,7 @@ class TestConditionalAuthenticationIntegration: assert isinstance(REQUIRE_AUTHENTICATION, bool) # Currently should be False (optional authentication) - assert REQUIRE_AUTHENTICATION == False + assert not REQUIRE_AUTHENTICATION class TestConditionalAuthenticationEnvironmentVariables: @@ -145,7 +145,7 @@ class TestConditionalAuthenticationEnvironmentVariables: REQUIRE_AUTHENTICATION, ) - assert REQUIRE_AUTHENTICATION == False + assert not REQUIRE_AUTHENTICATION def test_require_authentication_true(self): """Test that REQUIRE_AUTHENTICATION=true is parsed correctly when imported.""" @@ -160,7 +160,7 @@ class TestConditionalAuthenticationEnvironmentVariables: REQUIRE_AUTHENTICATION, ) - assert REQUIRE_AUTHENTICATION == True + assert REQUIRE_AUTHENTICATION def test_require_authentication_false_explicit(self): """Test that REQUIRE_AUTHENTICATION=false is parsed correctly when imported.""" @@ -175,7 +175,7 @@ class TestConditionalAuthenticationEnvironmentVariables: REQUIRE_AUTHENTICATION, ) - assert REQUIRE_AUTHENTICATION == False + assert not REQUIRE_AUTHENTICATION def test_require_authentication_case_insensitive(self): """Test that environment variable parsing is case insensitive when imported.""" @@ -204,7 +204,7 @@ class TestConditionalAuthenticationEnvironmentVariables: # The module-level variable should currently be False (set at import time) assert isinstance(REQUIRE_AUTHENTICATION, bool) - assert REQUIRE_AUTHENTICATION == False + assert not REQUIRE_AUTHENTICATION class TestConditionalAuthenticationEdgeCases: