-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use username and password from --proxy=URL
* When URL in --proxy=URL contains username and password (e.g. --proxy=https://user:[email protected]:3128), then user and pass are used as proxy_user and proxy_pass * The --proxyuser and --proxypassword have higher priority. Thus, it does not break backward compatibility. * Added one unit test for this case
- Loading branch information
1 parent
a99bb83
commit 7028232
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2484,6 +2484,24 @@ def test_list_by_default_with_options_from_super_class(self): | |
self.cc._validate_options() | ||
self.assertTrue(self.cc.options.list) | ||
|
||
def test_proxy_user_and_pass_from_url_overridden_by_cli_options(self): | ||
""" | ||
Test that --proxyuser and --proxypassword have higher priority than --proxy | ||
""" | ||
self.cc.main( | ||
[ | ||
"--proxy", | ||
"https://foo:[email protected]", | ||
"--proxyuser", | ||
"other-user", | ||
"--proxypassword", | ||
"other-password", | ||
] | ||
) | ||
self.cc._validate_options() | ||
self.assertEqual(self.cc.proxy_user, "other-user") | ||
self.assertEqual(self.cc.proxy_password, "other-password") | ||
|
||
def test_add_with_multiple_colons(self): | ||
self.cc.main(["--repo", "x", "--add", "url:http://example.com"]) | ||
self.cc._validate_options() | ||
|