2525def obtain (dest , url ):
2626 pass
2727
28+
2829@pytest .mark .parametrize (
2930 "url, vcs_type, domain" ,
3031 [
31- pytest .param ("git+http://github.com/jamesor/mongoose-versioner" , "git" , "github.com" , id = "git_http" ),
32- pytest .param ("git://github.com/jamesor/mongoose-versioner" , "git" , "github.com" , id = "git" ),
33- pytest .param ("git+https://github.com/jamesor/mongoose-versioner" , "git" , "github.com" , id = "git_https" ),
34- pytest .param ("git+ssh://github.com/jamesor/mongoose-versioner" , "git" , "github.com" , id = "git_ssh" ),
35- pytest .param ("git+file://github.com/jamesor/mongoose-versioner" , "git" , "github.com" , id = "git_file" ),
36- pytest .param ("git+git://github.com/jamesor/mongoose-versioner" , "git" , "github.com" , id = "git_git" ),
37- pytest .param ("bzr+http://gitlab.com/jamesor/mongoose-versioner" , "bzr" , "gitlab.com" , id = "bzr_http" ),
38- pytest .param ("bzr+https://gitlab.com/jamesor/mongoose-versioner" , "bzr" , "gitlab.com" , id = "bzr_https" ),
39- pytest .param ("bzr://gitlab.com/jamesor/mongoose-versioner" , "bzr" , "gitlab.com" , id = "bzr" ),
40- pytest .param ("bzr+ssh://gitlab.com/jamesor/mongoose-versioner" , "bzr" , "gitlab.com" , id = "bzr_ssh" ),
41- pytest .param ("bzr+ftp://gitlab.com/jamesor/mongoose-versioner" , "bzr" , "gitlab.com" , id = "bzr_ftp" ),
42- pytest .param ("bzr+sftp://gitlab.com/jamesor/mongoose-versioner" , "bzr" , "gitlab.com" , id = "bzr_sftp" ),
43- pytest .param ("bzr+lp://gitlab.com/jamesor/mongoose-versioner" , "bzr" , "gitlab.com" , id = "bzr_lp" ),
44- pytest .param ("hg://bitbucket.com/jamesor/mongoose-versioner" , "hg" , "bitbucket.com" , id = "hg" ),
45- pytest .param ("hg+file://bitbucket.com/jamesor/mongoose-versioner" , "hg" , "bitbucket.com" , id = "hg_file" ),
46- pytest .param ("hg+http://bitbucket.com/jamesor/mongoose-versioner" , "hg" , "bitbucket.com" , id = "hg_http" ),
47- pytest .param ("hg+https://bitbucket.com/jamesor/mongoose-versioner" , "hg" , "bitbucket.com" , id = "hg_https" ),
48- pytest .param ("hg+ssh://bitbucket.com/jamesor/mongoose-versioner" , "hg" , "bitbucket.com" , id = "hg_ssh" ),
49- pytest .param ("hg+static-http://bitbucket.com/jamesor/mongoose-versioner" , "hg" , "bitbucket.com" , id = "hg_static_http" ),
50- pytest .param ("svn://bitbucket.com/jamesor/mongoose-versioner" , "svn" , "bitbucket.com" , id = "svn" ),
51- pytest .param ("svn+http://bitbucket.com/jamesor/mongoose-versioner" , "svn" , "bitbucket.com" , id = "svn_http" ),
52- pytest .param ("svn+https://bitbucket.com/jamesor/mongoose-versioner" , "svn" , "bitbucket.com" , id = "svn_https" ),
53- pytest .param ("svn+svn://bitbucket.com/jamesor/mongoose-versioner" , "svn" , "bitbucket.com" , id = "svn_svn" )
32+ pytest .param (
33+ "git+http://github.com/jamesor/mongoose-versioner" ,
34+ "git" ,
35+ "github.com" ,
36+ id = "git_http" ,
37+ ),
38+ pytest .param (
39+ "git://github.com/jamesor/mongoose-versioner" , "git" , "github.com" , id = "git"
40+ ),
41+ pytest .param (
42+ "git+https://github.com/jamesor/mongoose-versioner" ,
43+ "git" ,
44+ "github.com" ,
45+ id = "git_https" ,
46+ ),
47+ pytest .param (
48+ "git+ssh://github.com/jamesor/mongoose-versioner" ,
49+ "git" ,
50+ "github.com" ,
51+ id = "git_ssh" ,
52+ ),
53+ pytest .param (
54+ "git+file://github.com/jamesor/mongoose-versioner" ,
55+ "git" ,
56+ "github.com" ,
57+ id = "git_file" ,
58+ ),
59+ pytest .param (
60+ "git+git://github.com/jamesor/mongoose-versioner" ,
61+ "git" ,
62+ "github.com" ,
63+ id = "git_git" ,
64+ ),
65+ pytest .param (
66+ "bzr+http://gitlab.com/jamesor/mongoose-versioner" ,
67+ "bzr" ,
68+ "gitlab.com" ,
69+ id = "bzr_http" ,
70+ ),
71+ pytest .param (
72+ "bzr+https://gitlab.com/jamesor/mongoose-versioner" ,
73+ "bzr" ,
74+ "gitlab.com" ,
75+ id = "bzr_https" ,
76+ ),
77+ pytest .param (
78+ "bzr://gitlab.com/jamesor/mongoose-versioner" , "bzr" , "gitlab.com" , id = "bzr"
79+ ),
80+ pytest .param (
81+ "bzr+ssh://gitlab.com/jamesor/mongoose-versioner" ,
82+ "bzr" ,
83+ "gitlab.com" ,
84+ id = "bzr_ssh" ,
85+ ),
86+ pytest .param (
87+ "bzr+ftp://gitlab.com/jamesor/mongoose-versioner" ,
88+ "bzr" ,
89+ "gitlab.com" ,
90+ id = "bzr_ftp" ,
91+ ),
92+ pytest .param (
93+ "bzr+sftp://gitlab.com/jamesor/mongoose-versioner" ,
94+ "bzr" ,
95+ "gitlab.com" ,
96+ id = "bzr_sftp" ,
97+ ),
98+ pytest .param (
99+ "bzr+lp://gitlab.com/jamesor/mongoose-versioner" ,
100+ "bzr" ,
101+ "gitlab.com" ,
102+ id = "bzr_lp" ,
103+ ),
104+ pytest .param (
105+ "hg://bitbucket.com/jamesor/mongoose-versioner" ,
106+ "hg" ,
107+ "bitbucket.com" ,
108+ id = "hg" ,
109+ ),
110+ pytest .param (
111+ "hg+file://bitbucket.com/jamesor/mongoose-versioner" ,
112+ "hg" ,
113+ "bitbucket.com" ,
114+ id = "hg_file" ,
115+ ),
116+ pytest .param (
117+ "hg+http://bitbucket.com/jamesor/mongoose-versioner" ,
118+ "hg" ,
119+ "bitbucket.com" ,
120+ id = "hg_http" ,
121+ ),
122+ pytest .param (
123+ "hg+https://bitbucket.com/jamesor/mongoose-versioner" ,
124+ "hg" ,
125+ "bitbucket.com" ,
126+ id = "hg_https" ,
127+ ),
128+ pytest .param (
129+ "hg+ssh://bitbucket.com/jamesor/mongoose-versioner" ,
130+ "hg" ,
131+ "bitbucket.com" ,
132+ id = "hg_ssh" ,
133+ ),
134+ pytest .param (
135+ "hg+static-http://bitbucket.com/jamesor/mongoose-versioner" ,
136+ "hg" ,
137+ "bitbucket.com" ,
138+ id = "hg_static_http" ,
139+ ),
140+ pytest .param (
141+ "svn://bitbucket.com/jamesor/mongoose-versioner" ,
142+ "svn" ,
143+ "bitbucket.com" ,
144+ id = "svn" ,
145+ ),
146+ pytest .param (
147+ "svn+http://bitbucket.com/jamesor/mongoose-versioner" ,
148+ "svn" ,
149+ "bitbucket.com" ,
150+ id = "svn_http" ,
151+ ),
152+ pytest .param (
153+ "svn+https://bitbucket.com/jamesor/mongoose-versioner" ,
154+ "svn" ,
155+ "bitbucket.com" ,
156+ id = "svn_https" ,
157+ ),
158+ pytest .param (
159+ "svn+svn://bitbucket.com/jamesor/mongoose-versioner" ,
160+ "svn" ,
161+ "bitbucket.com" ,
162+ id = "svn_svn" ,
163+ ),
54164 ],
55165)
56166@mock .patch ("fetchcode.vcs.vcs.get_backend_for_scheme" )
@@ -60,6 +170,7 @@ def test_fetch_via_vcs_returns_response(mock_backend, url, vcs_type, domain):
60170 assert response .vcs_type == vcs_type
61171 assert response .domain == domain
62172
173+
63174def test_fetch_with_invalid_scheme ():
64175 invalid_urls = [
65176 "https://github.com/TG1999/fetchcode" ,
0 commit comments