@@ -169,33 +169,39 @@ def test_git_is_commit_id_equal(git, rev_name, result):
169
169
170
170
# The non-SVN backends all use the same get_netloc_and_auth(), so only test
171
171
# Git as a representative.
172
- @pytest .mark .parametrize ('netloc , expected' , [
172
+ @pytest .mark .parametrize ('args , expected' , [
173
173
# Test a basic case.
174
- ('example.com' , ('example.com' , (None , None ))),
174
+ (( 'example.com' , 'https' ) , ('example.com' , (None , None ))),
175
175
# Test with username and password.
176
- ('user:[email protected] ' , ('user:[email protected] ' , (None , None ))),
176
+ (('user:[email protected] ' , 'https' ),
177
+ ('user:[email protected] ' , (None , None ))),
177
178
])
178
- def test_git__get_netloc_and_auth (netloc , expected ):
179
+ def test_git__get_netloc_and_auth (args , expected ):
179
180
"""
180
181
Test VersionControl.get_netloc_and_auth().
181
182
"""
182
- actual = Git ().get_netloc_and_auth (netloc )
183
+ netloc , scheme = args
184
+ actual = Git ().get_netloc_and_auth (netloc , scheme )
183
185
assert actual == expected
184
186
185
187
186
- @pytest .mark .parametrize ('netloc, expected' , [
187
- # Test a basic case.
188
- ('example.com' , ('example.com' , (None , None ))),
189
- # Test with username and no password.
190
- ('[email protected] ' , ('example.com' , ('user' , None ))),
191
- # Test with username and password.
192
- ('user:[email protected] ' , ('example.com' , ('user' , 'pass' ))),
188
+ @pytest .mark .parametrize ('args, expected' , [
189
+ # Test https.
190
+ (('example.com' , 'https' ), ('example.com' , (None , None ))),
191
+ # Test https with username and no password.
192
+ (('[email protected] ' , 'https' ), ('example.com' , ('user' , None ))),
193
+ # Test https with username and password.
194
+ (('user:[email protected] ' , 'https' ), ('example.com' , ('user' , 'pass' ))),
195
+ # Test ssh with username and password.
196
+ (('user:[email protected] ' , 'ssh' ),
197
+ ('user:[email protected] ' , (None , None ))),
193
198
])
194
- def test_subversion__get_netloc_and_auth (netloc , expected ):
199
+ def test_subversion__get_netloc_and_auth (args , expected ):
195
200
"""
196
201
Test Subversion.get_netloc_and_auth().
197
202
"""
198
- actual = Subversion ().get_netloc_and_auth (netloc )
203
+ netloc , scheme = args
204
+ actual = Subversion ().get_netloc_and_auth (netloc , scheme )
199
205
assert actual == expected
200
206
201
207
@@ -276,6 +282,28 @@ def test_bazaar__get_url_rev_and_auth(url, expected):
276
282
assert actual == (expected , None , (None , None ))
277
283
278
284
285
+ @pytest .mark .parametrize ('url, expected' , [
286
+ # Test an https URL.
287
+ ('svn+https://svn.example.com/MyProject#egg=MyProject' ,
288
+ ('https://svn.example.com/MyProject' , None , (None , None ))),
289
+ # Test an https URL with a username and password.
290
+ ('svn+https://user:[email protected] /MyProject#egg=MyProject' ,
291
+ ('https://svn.example.com/MyProject' , None , ('user' , 'pass' ))),
292
+ # Test an ssh URL.
293
+ ('svn+ssh://svn.example.com/MyProject#egg=MyProject' ,
294
+ ('svn+ssh://svn.example.com/MyProject' , None , (None , None ))),
295
+ # Test an ssh URL with a username.
296
+ ('svn+ssh://[email protected] /MyProject#egg=MyProject' ,
297
+ ('svn+ssh://[email protected] /MyProject' , None , (None , None ))),
298
+ ])
299
+ def test_subversion__get_url_rev_and_auth (url , expected ):
300
+ """
301
+ Test Subversion.get_url_rev_and_auth().
302
+ """
303
+ actual = Subversion ().get_url_rev_and_auth (url )
304
+ assert actual == expected
305
+
306
+
279
307
# The non-SVN backends all use the same make_rev_args(), so only test
280
308
# Git as a representative.
281
309
@pytest .mark .parametrize ('username, password, expected' , [
0 commit comments