@@ -60,29 +60,6 @@ def _resolve_url(page_url, url):
6060 return f"{ parsed .scheme } ://{ parsed .netloc } { path } { url } "
6161
6262
63- @pytest .mark .remote
64- async def test_main_page (app ):
65- """Check the main page and any links on it"""
66- r = await async_requests .get (app .url )
67- assert r .status_code == 200
68- soup = BeautifulSoup (r .text , "html5lib" )
69-
70- # check src links (style, images)
71- for el in soup .find_all (src = True ):
72- url = _resolve_url (app .url , el ["src" ])
73- r = await async_requests .get (url )
74- assert r .status_code == 200 , f"{ r .status_code } { url } "
75-
76- # check hrefs
77- for el in soup .find_all (href = True ):
78- href = el ["href" ]
79- if href .startswith ("#" ):
80- continue
81- url = _resolve_url (app .url , href )
82- r = await async_requests .get (url )
83- assert r .status_code == 200 , f"{ r .status_code } { url } "
84-
85-
8663@pytest .mark .remote
8764@pytest .mark .helm
8865async def test_custom_template (app ):
@@ -92,15 +69,6 @@ async def test_custom_template(app):
9269 assert "test-template" in r .text
9370
9471
95- @pytest .mark .remote
96- async def test_about_handler (app ):
97- # Check that the about page loads
98- r = await async_requests .get (app .url + "/about" )
99- assert r .status_code == 200
100- assert "This website is powered by" in r .text
101- assert binder_version .split ("+" )[0 ] in r .text
102-
103-
10472@pytest .mark .remote
10573async def test_versions_handler (app ):
10674 # Check that the about page loads
@@ -121,65 +89,6 @@ async def test_versions_handler(app):
12189 assert data ["binderhub" ].split ("+" )[0 ] == binder_version .split ("+" )[0 ]
12290
12391
124- @pytest .mark .parametrize (
125- "provider_prefix,repo,ref,path,path_type,status_code" ,
126- [
127- ("gh" , "binderhub-ci-repos/requirements" , "master" , "" , "" , 200 ),
128- ("gh" , "binderhub-ci-repos%2Frequirements" , "master" , "" , "" , 400 ),
129- ("gh" , "binderhub-ci-repos/requirements" , "master/" , "" , "" , 200 ),
130- (
131- "gh" ,
132- "binderhub-ci-repos/requirements" ,
133- "20c4fe55a9b2c5011d228545e821b1c7b1723652" ,
134- "index.ipynb" ,
135- "file" ,
136- 200 ,
137- ),
138- (
139- "gh" ,
140- "binderhub-ci-repos/requirements" ,
141- "20c4fe55a9b2c5011d228545e821b1c7b1723652" ,
142- "%2Fnotebooks%2Findex.ipynb" ,
143- "url" ,
144- 200 ,
145- ),
146- ("gh" , "binderhub-ci-repos/requirements" , "master" , "has%20space" , "file" , 200 ),
147- (
148- "gh" ,
149- "binderhub-ci-repos/requirements" ,
150- "master/" ,
151- "%2Fhas%20space%2F" ,
152- "file" ,
153- 200 ,
154- ),
155- (
156- "gh" ,
157- "binderhub-ci-repos/requirements" ,
158- "master" ,
159- "%2Fhas%20space%2F%C3%BCnicode.ipynb" ,
160- "file" ,
161- 200 ,
162- ),
163- ],
164- )
165- async def test_loading_page (
166- app , provider_prefix , repo , ref , path , path_type , status_code
167- ):
168- # repo = f'{org}/{repo_name}'
169- spec = f"{ repo } /{ ref } "
170- provider_spec = f"{ provider_prefix } /{ spec } "
171- query = f"{ path_type } path={ path } " if path else ""
172- uri = f"/v2/{ provider_spec } ?{ query } "
173- r = await async_requests .get (app .url + uri )
174- assert r .status_code == status_code , f"{ r .status_code } { uri } "
175- if status_code == 200 :
176- soup = BeautifulSoup (r .text , "html5lib" )
177- assert soup .find (id = "log-container" )
178- nbviewer_url = soup .find (id = "nbviewer-preview" ).find ("iframe" ).attrs ["src" ]
179- r = await async_requests .get (nbviewer_url )
180- assert r .status_code == 200 , f"{ r .status_code } { nbviewer_url } "
181-
182-
18392@pytest .mark .parametrize (
18493 "origin,host,expected_origin" ,
18594 [
0 commit comments