From 8c5ab00428a3b3ebbb8c346cc39ee4610d270151 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:24:03 +0000 Subject: [PATCH] refactor: extract test URL constant for better maintainability Address code review feedback by extracting the hardcoded test URL into a module-level constant to improve maintainability and ensure consistency across all test methods. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- tests/test_endpoint_registration.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_endpoint_registration.py b/tests/test_endpoint_registration.py index bd0a1b01..2d571c6e 100644 --- a/tests/test_endpoint_registration.py +++ b/tests/test_endpoint_registration.py @@ -7,6 +7,9 @@ that endpoints remain accessible after code refactoring or reorganization. import pytest +# Test constants +TEST_URL = "https://example.com/test.pdf" + @pytest.mark.unit class TestEndpointRegistration: @@ -17,7 +20,7 @@ class TestEndpointRegistration: # Make a request to the endpoint - it should not return 404 response = client.post( "/api/process-url", - json={"url": "https://example.com/test.pdf"} + json={"url": TEST_URL} ) # The endpoint exists if we don't get a 404 @@ -34,7 +37,7 @@ class TestEndpointRegistration: # Try POST request response = client.post( "/api/process-url", - json={"url": "https://example.com/test.pdf"} + json={"url": TEST_URL} ) # Should not return 405 (Method Not Allowed) @@ -55,7 +58,7 @@ class TestEndpointRegistration: if method == "get": response = client.get(endpoint) else: - response = client.post(endpoint, json={"url": "https://example.com/test.pdf"}) + response = client.post(endpoint, json={"url": TEST_URL}) # None of these should return 404 assert response.status_code != 404, (