[py]: handle named get_cookie and delete_cookie for None and empty strings#15073
[py]: handle named get_cookie and delete_cookie for None and empty strings#15073VietND96 merged 6 commits intoSeleniumHQ:trunkfrom
get_cookie and delete_cookie for None and empty strings#15073Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
250b9c7 to
9664721
Compare
…y strings (SeleniumHQ#15073) * handle `None` and empty string case for `get_cookie()` and `delete_cookie()` * run `format.sh` * apply suggestion for test cases --------- Co-authored-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
…y strings (SeleniumHQ#15073) * handle `None` and empty string case for `get_cookie()` and `delete_cookie()` * run `format.sh` * apply suggestion for test cases --------- Co-authored-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Addresses #15044 for py bindings.
Motivation and Context
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
Added validation to raise
ValueErrorfor empty or whitespace cookie names inget_cookieanddelete_cookie.Updated
get_cookieanddelete_cookiedocstrings to reflect new behavior.Introduced new tests to verify
ValueErroris raised for invalid cookie names.Ensured existing functionality remains unaffected by the changes.
Changes walkthrough 📝
webdriver.py
Add validation for cookie name in `get_cookie` and `delete_cookie`py/selenium/webdriver/remote/webdriver.py
ValueErrorfor empty or whitespace cookienames.
get_cookieanddelete_cookieto include newbehavior.
cookie_tests.py
Add tests for cookie name validationpy/test/selenium/webdriver/common/cookie_tests.py
get_cookieto raiseValueErrorfor empty names.delete_cookieto raiseValueErrorfor empty names.