|
9 | 9 | from tornado.httpclient import HTTPClientError |
10 | 10 | from traitlets.config import Config |
11 | 11 |
|
| 12 | +from jupyter_server._tz import isoformat |
| 13 | + |
12 | 14 |
|
13 | 15 | @pytest.fixture |
14 | 16 | def terminal_path(tmp_path): |
@@ -67,7 +69,7 @@ async def test_no_terminals(jp_fetch): |
67 | 69 | assert len(data) == 0 |
68 | 70 |
|
69 | 71 |
|
70 | | -async def test_terminal_create(jp_fetch): |
| 72 | +async def test_terminal_create(jp_fetch, jp_serverapp): |
71 | 73 | resp = await jp_fetch( |
72 | 74 | "api", |
73 | 75 | "terminals", |
@@ -115,7 +117,7 @@ async def test_terminal_create_with_kwargs(jp_fetch, jp_ws_fetch, terminal_path) |
115 | 117 | assert data["name"] == term_name |
116 | 118 |
|
117 | 119 |
|
118 | | -async def test_terminal_create_with_cwd(jp_fetch, jp_ws_fetch, terminal_path): |
| 120 | +async def test_terminal_create_with_cwd(jp_fetch, jp_ws_fetch, terminal_path, jp_serverapp): |
119 | 121 | resp = await jp_fetch( |
120 | 122 | "api", |
121 | 123 | "terminals", |
@@ -147,6 +149,12 @@ async def test_terminal_create_with_cwd(jp_fetch, jp_ws_fetch, terminal_path): |
147 | 149 |
|
148 | 150 | assert os.path.basename(terminal_path) in message_stdout |
149 | 151 |
|
| 152 | + resp = await jp_fetch("api", "status") |
| 153 | + data = json.loads(resp.body.decode()) |
| 154 | + assert data["last_activity"] == isoformat( |
| 155 | + jp_serverapp.web_app.settings["terminal_last_activity"] |
| 156 | + ) |
| 157 | + |
150 | 158 |
|
151 | 159 | @pytest.mark.skip(reason="Not yet working") |
152 | 160 | async def test_terminal_create_with_relative_cwd( |
|
0 commit comments