From ae084e197b3ac9a5e2be434f2455fbff3013af55 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Tue, 30 Sep 2025 02:02:29 +0530 Subject: [PATCH] fix: runtime errors in api server --- apps/api/plane/tests/smoke/test_auth_smoke.py | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/apps/api/plane/tests/smoke/test_auth_smoke.py b/apps/api/plane/tests/smoke/test_auth_smoke.py index fd22f55978..c920606248 100644 --- a/apps/api/plane/tests/smoke/test_auth_smoke.py +++ b/apps/api/plane/tests/smoke/test_auth_smoke.py @@ -19,9 +19,7 @@ class TestAuthSmoke: # For bad credentials, any of these status codes would be valid # The test shouldn't be brittle to minor implementation changes - assert ( - response.status_code != 500 - ), "Authentication should not cause server errors" + assert response.status_code != 500, "Authentication should not cause server errors" assert response.status_code != 404, "Authentication endpoint should exist" if response.status_code == 200: @@ -51,8 +49,8 @@ class TestAuthSmoke: ) # Successful auth should not be a client error or server error - assert ( - response.status_code not in range(400, 600) + assert response.status_code not in range( + 400, 600 ), f"Authentication with valid credentials failed with status {response.status_code}" # Specific validation based on response type @@ -70,27 +68,17 @@ class TestAuthSmoke: data = response.json() # If it's a token response if "access_token" in data: -<<<<<<< HEAD assert "refresh_token" in data, "JWT auth should return both access and refresh tokens" -======= -<<<<<<< HEAD - assert "refresh_token" in data, "JWT auth should return both access and refresh tokens" -======= - assert ( - "refresh_token" in data - ), "JWT auth should return both access and refresh tokens" ->>>>>>> d63015f53db1ab1962ff810ae82dcfb1a5478140 ->>>>>>> ebeac413faf27b87803939d3aa3829b38a66e19c # If it's a user session response elif "user" in data: - assert "is_authenticated" in data and data["is_authenticated"], ( - "User session response should indicate authentication" - ) + assert ( + "is_authenticated" in data and data["is_authenticated"] + ), "User session response should indicate authentication" # Otherwise it should at least indicate success else: - assert not any(error_key in data for error_key in ["error", "error_code", "detail"]), ( - "Success response should not contain error keys" - ) + assert not any( + error_key in data for error_key in ["error", "error_code", "detail"] + ), "Success response should not contain error keys" except ValueError: # Non-JSON is acceptable if it's a redirect or HTML response pass