@@ -157,8 +157,16 @@ def test_get_datafile_contents(gh, session):
157157 "github_host, is_public, expected" ,
158158 [
159159 ("https://github.com" , False , "https://github.com/foo/bar/raw/baz/qux" ),
160- ("https://github.com" , True , "https://raw.githubusercontent.com/foo/bar/baz/qux" ),
161- ("https://github.mycompany.com" , True , "https://github.mycompany.com/foo/bar/raw/baz/qux" ),
160+ (
161+ "https://github.com" ,
162+ True ,
163+ "https://raw.githubusercontent.com/foo/bar/baz/qux" ,
164+ ),
165+ (
166+ "https://github.mycompany.com" ,
167+ True ,
168+ "https://github.mycompany.com/foo/bar/raw/baz/qux" ,
169+ ),
162170 ],
163171)
164172def test_get_raw_file_url (github_host , is_public , expected ):
@@ -177,17 +185,32 @@ def test_get_raw_file_url(github_host, is_public, expected):
177185 [
178186 ("https://github.com" , "" , "https://github.com/foo/bar/tree/baz" ),
179187 ("https://github.com" , "/" , "https://github.com/foo/bar/tree/baz" ),
180- ("https://github.com" , "qux" , "https://github.com/foo/bar/blob/baz/qux" ), # blob
188+ (
189+ "https://github.com" ,
190+ "qux" ,
191+ "https://github.com/foo/bar/blob/baz/qux" ,
192+ ), # blob
181193 ("https://github.com" , "qux/" , "https://github.com/foo/bar/tree/baz/qux" ),
182- ("https://github.mycompany.com" , "/qux" , "https://github.mycompany.com/foo/bar/blob/baz/qux" ), # blob
183- ("https://github.mycompany.com" , "/qux/" , "https://github.mycompany.com/foo/bar/tree/baz/qux" ),
194+ (
195+ "https://github.mycompany.com" ,
196+ "/qux" ,
197+ "https://github.mycompany.com/foo/bar/blob/baz/qux" ,
198+ ), # blob
199+ (
200+ "https://github.mycompany.com" ,
201+ "/qux/" ,
202+ "https://github.mycompany.com/foo/bar/tree/baz/qux" ,
203+ ),
184204 ],
185205)
186206def test_get_repo_file_url (github_host , path , expected ):
187- result = storage .get_repo_file_url (github_host = github_host , repository = "foo/bar" , branch = "baz" , path = path )
207+ result = storage .get_repo_file_url (
208+ github_host = github_host , repository = "foo/bar" , branch = "baz" , path = path
209+ )
188210
189211 assert result == expected
190212
213+
191214@pytest .mark .parametrize (
192215 "github_host" ,
193216 [
@@ -196,17 +219,28 @@ def test_get_repo_file_url(github_host, path, expected):
196219 ],
197220)
198221def test_get_repo_file_url__no_path (github_host ):
199- result = storage .get_repo_file_url (github_host = github_host , repository = "foo/bar" , branch = "baz" )
222+ result = storage .get_repo_file_url (
223+ github_host = github_host , repository = "foo/bar" , branch = "baz"
224+ )
200225
201226 assert result == f"{ github_host } /foo/bar/tree/baz"
202227
228+
203229@pytest .mark .parametrize (
204230 "github_host, expected" ,
205231 [
206- ("https://github.com" , "https://htmlpreview.github.io/?https://github.com/foo/bar/blob/baz/htmlcov/index.html" ),
207- ("https://github.mycompany.com" , "https://github.mycompany.com/foo/bar/blob/baz/htmlcov/index.html" ),
232+ (
233+ "https://github.com" ,
234+ "https://htmlpreview.github.io/?https://github.com/foo/bar/blob/baz/htmlcov/index.html" ,
235+ ),
236+ (
237+ "https://github.mycompany.com" ,
238+ "https://github.mycompany.com/foo/bar/blob/baz/htmlcov/index.html" ,
239+ ),
208240 ],
209241)
210242def test_get_html_report_url (github_host , expected ):
211- result = storage .get_html_report_url (github_host = github_host , repository = "foo/bar" , branch = "baz" )
243+ result = storage .get_html_report_url (
244+ github_host = github_host , repository = "foo/bar" , branch = "baz"
245+ )
212246 assert result == expected
0 commit comments