PYTHON-5773 Increase uri_parser_shared.py coverage to 81%#2758
Open
aclark4life wants to merge 1 commit intomongodb:masterfrom
Open
PYTHON-5773 Increase uri_parser_shared.py coverage to 81%#2758aclark4life wants to merge 1 commit intomongodb:masterfrom
aclark4life wants to merge 1 commit intomongodb:masterfrom
Conversation
Add 11 new test methods to test_uri_parser.py covering previously untested branches: _unquoted_percent, parse_ipv6_literal_host, parse_host (case normalization and port boundaries), TLS option conflicts in _handle_security_options, mixed option delimiters, duplicate option warnings, empty authSource, _check_options conflicts (directConnection/loadBalanced), and SRV URI structural validation.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR increases branch/line coverage for pymongo/uri_parser_shared.py by adding focused unit tests in test/test_uri_parser.py, targeting previously untested validation and option-parsing paths.
Changes:
- Add direct tests for
_unquoted_percent,parse_ipv6_literal_host, andparse_host(case normalization + port boundary handling). - Add tests for URI option parsing/validation edge cases (TLS conflicts, mixed delimiters, duplicate-option warnings, empty
authSource). - Add tests for URI structural validation, including SRV-specific constraints and option incompatibilities.
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.
PYTHON-5773
Changes in this PR
Add 11 new test methods to test_uri_parser.py covering previously untested branches:
_unquoted_percentdirect branch coverageparse_ipv6_literal_hostdirect branch coverageparse_host case normalizationand port boundaries_handle_security_optionsauthSourcerejection_check_optionsconflicts (directConnection/loadBalanced)Test Plan
Checklist
Checklist for Author
Checklist for Reviewer