Fix three failing CxOne test suites - #226
Merged
Merged
Conversation
cx-happy-yang
commented
Sep 8, 2026
Contributor
- test_dast_results_api: import get_results from dastResultsAPI directly. The name exported by CheckmarxPythonSDK.CxOne resolves to riskManagementAPI.get_results (different endpoint and signature) because that import comes later in CxOne/init.py.
- dastScanAPI.run_scan: read upload files fully and pass bytes to httpx instead of open handles. httpx does not close caller-owned file objects, which leaked the handle and made os.unlink fail with WinError 32 on Windows.
- test_versions_api: assert the SAST version matches a semver shape instead of hardcoding 9.7.4; the server upgrades on its own schedule.
- test_dast_results_api: import get_results from dastResultsAPI directly. The name exported by CheckmarxPythonSDK.CxOne resolves to riskManagementAPI.get_results (different endpoint and signature) because that import comes later in CxOne/__init__.py. - dastScanAPI.run_scan: read upload files fully and pass bytes to httpx instead of open handles. httpx does not close caller-owned file objects, which leaked the handle and made os.unlink fail with WinError 32 on Windows. - test_versions_api: assert the SAST version matches a semver shape instead of hardcoding 9.7.4; the server upgrades on its own schedule. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Great job! No new security vulnerabilities introduced in this pull request |
Contributor
|
Hi @cx-happy-yang, |
Contributor
Author
|
Make sense. Let me check. |
Four names in CxOne/__init__.py were exported by two different API modules, so the later import silently shadowed the earlier one and the package-level name resolved to the wrong endpoint: - dastResultsAPI.get_results -> dast_get_results (riskManagementAPI keeps get_results) - byorResultsHandlerAPI.create_byor_import -> create_byor_import_v1 (v2 keeps create_byor_import) - queryEditorAPI.get_all_queries -> get_query_editor_queries - queryEditorAPI.get_the_logs_associated_to_the_audit_session -> get_query_editor_session_logs (sastQueriesAuditAPI keeps its plain names) Breaking change: the renamed class methods and module-level functions are no longer available under their old names. Tests and docs updated accordingly. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
cx-james-bostock
approved these changes
Sep 9, 2026
cx-james-bostock
left a comment
Contributor
There was a problem hiding this comment.
Hi @cx-happy-yang,
Looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
