Skip to content

Commit b40dd0e

Browse files
committed
[py] Add test for warning when embedding user:pass in URL
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 9ae1d7b commit b40dd0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

py/test/unit/selenium/webdriver/remote/remote_connection_tests.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,13 @@ def test_get_remote_connection_headers_defaults():
6969

7070
def test_get_remote_connection_headers_adds_auth_header_if_pass():
7171
url = "http://user:pass@remote"
72-
headers = RemoteConnection.get_remote_connection_headers(parse.urlparse(url))
72+
with pytest.warns(None) as record:
73+
headers = RemoteConnection.get_remote_connection_headers(parse.urlparse(url))
7374
assert headers.get("Authorization") == "Basic dXNlcjpwYXNz"
75+
assert (
76+
record[0].message.args[0]
77+
== "Embedding username and password in URL could be insecure, use ClientConfig instead"
78+
)
7479

7580

7681
def test_get_remote_connection_headers_adds_keep_alive_if_requested():

0 commit comments

Comments
 (0)