Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b40dd0e

Browse files
committedNov 6, 2024··
[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

+6-1
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)
Please sign in to comment.