1
-
2
1
import os
3
2
import getpass
4
- import pathlib
5
3
import pytest
6
4
import logging
7
-
8
5
from unittest .mock import patch
9
6
10
-
11
7
from traitlets import TraitError
12
8
from traitlets .tests .utils import check_help_all_output
13
-
14
9
from jupyter_core .application import NoStart
15
10
16
-
17
11
from jupyter_server .serverapp import (
18
- ServerApp ,
12
+ ServerApp ,
19
13
list_running_servers ,
20
14
JupyterPasswordApp ,
21
15
JupyterServerStopApp
@@ -35,12 +29,12 @@ def test_server_info_file(tmp_path, configurable_serverapp):
35
29
servers = list (list_running_servers (app .runtime_dir ))
36
30
37
31
assert len (servers ) == 1
38
- sinfo = servers [0 ]
39
-
32
+ sinfo = servers [0 ]
33
+
40
34
assert sinfo ['port' ] == app .port
41
35
assert sinfo ['url' ] == app .connection_url
42
36
assert sinfo ['version' ] == app .version
43
-
37
+
44
38
app .remove_server_info_file ()
45
39
46
40
assert list (list_running_servers (app .runtime_dir )) == []
@@ -62,7 +56,7 @@ def test_root_dir(tmp_path, configurable_serverapp):
62
56
)
63
57
def invalid_root_dir (tmp_path , request ):
64
58
path = tmp_path .joinpath (* request .param )
65
- # If the path is a file, create it.
59
+ # If the path is a file, create it.
66
60
if os .path .splitext (str (path ))[1 ] != '' :
67
61
path .write_text ('' )
68
62
return str (path )
@@ -90,10 +84,10 @@ def valid_root_dir(tmp_path, request):
90
84
def test_valid_root_dir (valid_root_dir , configurable_serverapp ):
91
85
app = configurable_serverapp (root_dir = valid_root_dir )
92
86
root_dir = valid_root_dir
93
- # If nested path, the last slash should
87
+ # If nested path, the last slash should
94
88
# be stripped by the root_dir trait.
95
89
if root_dir != '/' :
96
- root_dir = valid_root_dir .rstrip ('/' )
90
+ root_dir = valid_root_dir .rstrip ('/' )
97
91
assert app .root_dir == root_dir
98
92
99
93
0 commit comments