Skip to content

Commit 1b0944b

Browse files
committed
fix: remove redundant identity check in file parameter test
- Replaced 'assert file_param is not None' with meaningful assertions - Check file_param.description and hasattr for json_schema_extra - Addresses SonarCloud quality issue S5727: comparison to None should not be constant - Improves test meaningfulness and code maintainability
1 parent 41091a3 commit 1b0944b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/functional/event_handler/_pydantic/test_uploadfile_coverage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,9 @@ def test_file_parameter_json_schema_extra(self):
222222
# Create a File parameter with json_schema_extra
223223
file_param = File(description="Test file", json_schema_extra={"maxLength": 1000})
224224

225-
# Verify it doesn't crash and handles the extra parameters
226-
assert file_param is not None
225+
# Verify the file parameter has the expected attributes
226+
assert file_param.description == "Test file"
227+
assert hasattr(file_param, "json_schema_extra")
227228

228229
def test_fix_upload_file_schema_references_complex(self):
229230
"""Test schema fix with complex schema structures."""

0 commit comments

Comments
 (0)