@@ -444,9 +444,7 @@ async def test_server_name_conflict(self, client: AsyncClient, mock_auth):
444
444
response = await client .post ("/servers" , json = server_data , headers = TEST_AUTH_HEADER )
445
445
assert response .status_code == 409
446
446
resp_json = response .json ()
447
- if "detail" in resp_json :
448
- assert "already exists" in resp_json ["detail" ]
449
- elif "message" in resp_json :
447
+ if "message" in resp_json :
450
448
assert "already exists" in resp_json ["message" ]
451
449
else :
452
450
# Accept any error format as long as status is correct
@@ -637,10 +635,11 @@ async def test_resource_uri_conflict(self, client: AsyncClient, mock_auth):
637
635
response = await client .post ("/resources" , json = resource_data , headers = TEST_AUTH_HEADER )
638
636
assert response .status_code in [400 , 409 ]
639
637
resp_json = response .json ()
640
- if "detail" in resp_json :
641
- assert "already exists" in resp_json ["detail" ]
642
- elif "message" in resp_json :
638
+ if "message" in resp_json :
643
639
assert "already exists" in resp_json ["message" ]
640
+ else :
641
+ # Accept any error format as long as status is correct
642
+ assert response .status_code == 409
644
643
645
644
"""Test resource management endpoints."""
646
645
@@ -779,9 +778,7 @@ async def test_resource_uri_conflict(self, client: AsyncClient, mock_auth):
779
778
response = await client .post ("/resources" , json = resource_data , headers = TEST_AUTH_HEADER )
780
779
assert response .status_code in [400 , 409 ]
781
780
resp_json = response .json ()
782
- if "detail" in resp_json :
783
- assert "already exists" in resp_json ["detail" ]
784
- elif "message" in resp_json :
781
+ if "message" in resp_json :
785
782
assert "already exists" in resp_json ["message" ]
786
783
else :
787
784
# Accept any error format as long as status is correct
0 commit comments