test(notes): Modify tests with updated error handling
This commit is contained in:
@@ -334,10 +334,13 @@ async def test_mcp_notes_etag_conflict(
|
||||
)
|
||||
|
||||
# 4. Verify the update was rejected with a 412 error
|
||||
assert conflict_result.isError is True, "Update with stale ETag should fail"
|
||||
error_content = conflict_result.content[0].text
|
||||
assert "modified by someone else" in error_content or "412" in error_content, (
|
||||
f"Expected conflict error message, got: {error_content}"
|
||||
# The MCP framework doesn't set isError=True for ErrorResponse, so check the response content
|
||||
response_content = conflict_result.content[0].text
|
||||
response_data = json.loads(response_content)
|
||||
|
||||
assert response_data["success"] is False, "Update with stale ETag should fail"
|
||||
assert "modified by someone else" in response_data["error"], (
|
||||
f"Expected conflict error message, got: {response_data}"
|
||||
)
|
||||
|
||||
logger.info("Successfully verified ETag conflict handling via MCP")
|
||||
|
||||
Reference in New Issue
Block a user