Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions py/selenium/webdriver/common/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

"""The Proxy implementation."""

import warnings


class ProxyTypeFactory:
"""Factory for proxy types."""
Expand Down Expand Up @@ -66,14 +64,6 @@ def __get__(self, obj, cls):
def __set__(self, obj, value):
if self.name == "autodetect" and not isinstance(value, bool):
raise ValueError("Autodetect proxy value needs to be a boolean")
if self.name == "ftpProxy":
# TODO: Remove ftpProxy in future version and remove deprecation warning
# https://github.com/SeleniumHQ/selenium/issues/15905
warnings.warn(
"ftpProxy is deprecated and will be removed in the future",
DeprecationWarning,
stacklevel=2,
)
getattr(obj, "_verify_proxy_type_compatibility")(self.p_type)
setattr(obj, "proxyType", self.p_type)
setattr(obj, self.name, value)
Expand All @@ -84,7 +74,6 @@ class Proxy:

proxyType = ProxyType.UNSPECIFIED
autodetect = False
ftpProxy = "" # TODO: Remove ftpProxy in future version and remove deprecation warning
httpProxy = ""
noProxy = ""
proxyAutoconfigUrl = ""
Expand All @@ -98,10 +87,6 @@ class Proxy:
auto_detect = _ProxyTypeDescriptor("autodetect", ProxyType.AUTODETECT)
"""Proxy autodetection setting (boolean)."""

# TODO: Remove ftpProxy in future version and remove deprecation warning
ftp_proxy = _ProxyTypeDescriptor("ftpProxy", ProxyType.MANUAL)
"""FTP proxy address (deprecated)."""

http_proxy = _ProxyTypeDescriptor("httpProxy", ProxyType.MANUAL)
"""HTTP proxy address."""

Expand Down Expand Up @@ -135,15 +120,6 @@ def __init__(self, raw=None):
if raw:
if "proxyType" in raw and raw["proxyType"]:
self.proxy_type = ProxyType.load(raw["proxyType"])
# TODO: Remove ftpProxy in future version and remove deprecation warning
# https://github.com/SeleniumHQ/selenium/issues/15905
if "ftpProxy" in raw and raw["ftpProxy"]:
warnings.warn(
"ftpProxy is deprecated and will be removed in the future",
DeprecationWarning,
stacklevel=2,
)
self.ftp_proxy = raw["ftpProxy"]
if "httpProxy" in raw and raw["httpProxy"]:
self.http_proxy = raw["httpProxy"]
if "noProxy" in raw and raw["noProxy"]:
Expand Down Expand Up @@ -186,10 +162,8 @@ def _verify_proxy_type_compatibility(self, compatible_proxy):

def to_capabilities(self):
proxy_caps = {"proxyType": self.proxyType["string"].lower()}
# TODO: Remove ftpProxy in future version and remove deprecation warning
proxies = [
"autodetect",
"ftpProxy",
"httpProxy",
"proxyAutoconfigUrl",
"sslProxy",
Expand Down
12 changes: 0 additions & 12 deletions py/test/selenium/webdriver/common/proxy_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

MANUAL_PROXY = {
"httpProxy": "some.url:1234",
# TODO: Remove ftpProxy in future (currently deprecated)
# https://github.com/SeleniumHQ/selenium/issues/15905
"ftpProxy": "ftp.proxy",
"noProxy": "localhost, foo.localhost",
"sslProxy": "ssl.proxy:1234",
"socksProxy": "socks.proxy:65555",
Expand All @@ -45,9 +42,6 @@
def test_can_add_manual_proxy_to_options():
proxy = Proxy()
proxy.http_proxy = MANUAL_PROXY["httpProxy"]
# TODO: Remove ftpProxy in future (currently deprecated)
# https://github.com/SeleniumHQ/selenium/issues/15905
proxy.ftp_proxy = MANUAL_PROXY["ftpProxy"]
proxy.no_proxy = MANUAL_PROXY["noProxy"]
proxy.sslProxy = MANUAL_PROXY["sslProxy"]
proxy.socksProxy = MANUAL_PROXY["socksProxy"]
Expand Down Expand Up @@ -102,9 +96,6 @@ def test_can_init_manual_proxy():

assert ProxyType.MANUAL == proxy.proxy_type
assert MANUAL_PROXY["httpProxy"] == proxy.http_proxy
# TODO: Remove ftpProxy in future (currently deprecated)
# https://github.com/SeleniumHQ/selenium/issues/15905
assert MANUAL_PROXY["ftpProxy"] == proxy.ftp_proxy
assert MANUAL_PROXY["noProxy"] == proxy.no_proxy
assert MANUAL_PROXY["sslProxy"] == proxy.sslProxy
assert MANUAL_PROXY["socksProxy"] == proxy.socksProxy
Expand All @@ -129,9 +120,6 @@ def test_can_init_empty_proxy():
proxy = Proxy()
assert ProxyType.UNSPECIFIED == proxy.proxy_type
assert "" == proxy.http_proxy
# TODO: Remove ftpProxy in future (currently deprecated)
# https://github.com/SeleniumHQ/selenium/issues/15905
assert "" == proxy.ftp_proxy
assert "" == proxy.no_proxy
assert "" == proxy.sslProxy
assert "" == proxy.socksProxy
Expand Down