Skip to content

[py] Add unit tests for selenium.webdriver.common.proxy#17383

Open
EternalRights wants to merge 5 commits intoSeleniumHQ:trunkfrom
EternalRights:add-proxy-unit-tests
Open

[py] Add unit tests for selenium.webdriver.common.proxy#17383
EternalRights wants to merge 5 commits intoSeleniumHQ:trunkfrom
EternalRights:add-proxy-unit-tests

Conversation

@EternalRights
Copy link
Copy Markdown

The selenium.webdriver.common.proxy module (Proxy, ProxyType, ProxyTypeFactory) had no unit test coverage. This adds tests for:

  • ProxyType constants and load() with string/dict lookup
  • Proxy init from raw dict (manual, PAC, autodetect, socks configs)
  • _ProxyTypeDescriptor behavior (auto-detect, http_proxy, ssl_proxy, etc. and their type-switching side effects)
  • Proxy.to_capabilities() output format
  • Proxy.to_bidi_dict() including noProxy string-to-list conversion

35 tests, all passing locally with python -m pytest py/test/unit/selenium/webdriver/common/proxy_tests.py -v.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 24, 2026

CLA assistant check
All committers have signed the CLA.

@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Add unit tests for selenium.webdriver.common.proxy module

🧪 Tests

Grey Divider

Walkthroughs

Description
• Add comprehensive unit tests for selenium.webdriver.common.proxy module
• Test ProxyType constants and load() method with string/dict lookup
• Test Proxy initialization from raw dict with various proxy configurations
• Test _ProxyTypeDescriptor behavior and type-switching side effects
• Test Proxy.to_capabilities() and Proxy.to_bidi_dict() output formats

Grey Divider

File Changes

1. py/test/unit/selenium/webdriver/common/proxy_tests.py 🧪 Tests +246/-0

Comprehensive unit tests for proxy module

• New test file with 35 unit tests covering ProxyType, Proxy initialization, and descriptor
 behavior
• Tests for ProxyType constants (DIRECT, MANUAL, PAC, AUTODETECT, SYSTEM, UNSPECIFIED)
 and load() method
• Tests for Proxy initialization with manual, PAC, autodetect, and SOCKS proxy configurations
• Tests for descriptor property setters (auto_detect, http_proxy, ssl_proxy,
 proxy_autoconfig_url, socks_proxy) and type-switching behavior
• Tests for to_capabilities() and to_bidi_dict() methods including noProxy string-to-list
 conversion

py/test/unit/selenium/webdriver/common/proxy_tests.py


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented Apr 24, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@selenium-ci selenium-ci added the C-py Python Bindings label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-py Python Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants