@@ -22,15 +22,12 @@ async def test_hidden_files(jp_fetch, jp_serverapp, jp_root_dir):
22
22
dirs = not_hidden + hidden
23
23
24
24
for d in dirs :
25
- path = jp_root_dir / d .replace ('/' , os .sep )
25
+ path = jp_root_dir / d .replace ('/' , os .sep )
26
26
path .mkdir (parents = True , exist_ok = True )
27
27
path .joinpath ('foo' ).write_text ('foo' )
28
28
path .joinpath ('.foo' ).write_text ('.foo' )
29
29
30
-
31
30
for d in not_hidden :
32
- path = jp_root_dir / d .replace ('/' , os .sep )
33
-
34
31
r = await jp_fetch (
35
32
'files' , d , 'foo' ,
36
33
method = 'GET'
@@ -44,9 +41,7 @@ async def test_hidden_files(jp_fetch, jp_serverapp, jp_root_dir):
44
41
)
45
42
assert expected_http_error (e , 404 )
46
43
47
-
48
44
for d in hidden :
49
- path = jp_root_dir / d .replace ('/' , os .sep )
50
45
for foo in ('foo' , '.foo' ):
51
46
with pytest .raises (tornado .httpclient .HTTPClientError ) as e :
52
47
r = await jp_fetch (
@@ -58,8 +53,6 @@ async def test_hidden_files(jp_fetch, jp_serverapp, jp_root_dir):
58
53
jp_serverapp .contents_manager .allow_hidden = True
59
54
60
55
for d in not_hidden :
61
- path = jp_root_dir / d .replace ('/' , os .sep )
62
-
63
56
r = await jp_fetch (
64
57
'files' , d , 'foo' ,
65
58
method = 'GET'
@@ -72,15 +65,13 @@ async def test_hidden_files(jp_fetch, jp_serverapp, jp_root_dir):
72
65
)
73
66
assert r .body .decode () == '.foo'
74
67
75
- for d in hidden :
76
- path = jp_root_dir / d .replace ('/' , os .sep )
77
-
78
- for foo in ('foo' , '.foo' ):
79
- r = await jp_fetch (
80
- 'files' , d , foo ,
81
- method = 'GET'
82
- )
83
- assert r .body .decode () == foo
68
+ for d in hidden :
69
+ for foo in ('foo' , '.foo' ):
70
+ r = await jp_fetch (
71
+ 'files' , d , foo ,
72
+ method = 'GET'
73
+ )
74
+ assert r .body .decode () == foo
84
75
85
76
86
77
async def test_contents_manager (jp_fetch , jp_serverapp , jp_root_dir ):
0 commit comments