File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,28 @@ def maybe_hidden(request):
25
25
TIMEOUTS = dict (
26
26
# default is 20.0
27
27
connect_timeout = 0.0 ,
28
- # already set upstream?
29
- # request_timeout=40 .0
28
+ # needs patch below
29
+ request_timeout = 0 .0
30
30
)
31
31
32
+ # shouldn't be overloading this
33
+ @pytest .fixture
34
+ def jp_fetch (jp_serverapp , http_server_client , jp_auth_header , jp_base_url ):
35
+ def client_fetch (* parts , headers = {}, params = {}, ** kwargs ):
36
+ # Handle URL strings
37
+ path_url = url_escape (url_path_join (jp_base_url , * parts ), plus = False )
38
+ params_url = urllib .parse .urlencode (params )
39
+ url = path_url + "?" + params_url
40
+ # Add auth keys to header
41
+ headers .update (jp_auth_header )
42
+ # Make request.
43
+ kwargs .setdefault ("request_timeout" , 20.0 )
44
+ return http_server_client .fetch (
45
+ url , headers = headers , ** kwargs
46
+ )
47
+ return client_fetch
48
+
49
+
32
50
async def fetch_expect_200 (jp_fetch , * path_parts ):
33
51
r = await jp_fetch ('files' , * path_parts , method = 'GET' , ** TIMEOUTS )
34
52
assert (r .body .decode () == path_parts [- 1 ]), (path_parts , r .body )
You can’t perform that action at this time.
0 commit comments