@@ -150,15 +150,38 @@ def test_get_repository_config_missing(config_file):
150150 assert utils .get_repository_from_config (config_file , "pypi" ) == exp
151151
152152
153- def test_get_repository_config_url_with_auth (config_file ):
154- repository_url = "https://user:pass@notexisting.python.org/pypi"
155- exp = {
156- "repository" : "https://notexisting.python.org/pypi" ,
157- "username" : "user" ,
158- "password" : "pass" ,
159- }
160- assert utils .get_repository_from_config (config_file , "foo" , repository_url ) == exp
161- assert utils .get_repository_from_config (config_file , "pypi" , repository_url ) == exp
153+ @pytest .mark .parametrize (
154+ "repository_url, expected_config" ,
155+ [
156+ (
157+ "https://user:pass@notexisting.python.org/pypi" ,
158+ {
159+ "repository" : "https://notexisting.python.org/pypi" ,
160+ "username" : "user" ,
161+ "password" : "pass" ,
162+ },
163+ ),
164+ (
165+ "https://auser:pass@pypi.proxy.local.repo.net:8443" ,
166+ {
167+ "repository" : "https://pypi.proxy.local.repo.net:8443" ,
168+ "username" : "auser" ,
169+ "password" : "pass" ,
170+ },
171+ ),
172+ ],
173+ )
174+ def test_get_repository_config_url_with_auth (
175+ config_file , repository_url , expected_config
176+ ):
177+ assert (
178+ utils .get_repository_from_config (config_file , "foo" , repository_url )
179+ == expected_config
180+ )
181+ assert (
182+ utils .get_repository_from_config (config_file , "pypi" , repository_url )
183+ == expected_config
184+ )
162185
163186
164187@pytest .mark .parametrize (
0 commit comments