22import os
33from unittest .mock import MagicMock
44
5- import pytest
65from jupyter_server .auth import Authorizer
76from jupyter_server .serverapp import ServerApp
87from tornado .websocket import WebSocketHandler
98
109
11- @pytest .mark .asyncio
1210async def test_serverapp (jp_serverapp ):
1311 assert isinstance (jp_serverapp , ServerApp )
1412
1513
16- @pytest .mark .asyncio
1714async def test_get_api_spec (jp_fetch ):
1815 response = await jp_fetch ("api" , "spec.yaml" , method = "GET" )
1916 assert response .code == 200
2017
2118
22- @pytest .mark .asyncio
2319async def test_send_request (send_request ):
2420 code = await send_request ("api/spec.yaml" , method = "GET" )
2521 assert code == 200
2622
2723
28- @pytest .mark .asyncio
2924async def test_connection (jp_fetch , jp_ws_fetch , jp_http_port , jp_auth_header ):
3025 # Create kernel
3126 r = await jp_fetch ("api" , "kernels" , method = "POST" , body = "{}" )
@@ -41,7 +36,6 @@ async def test_connection(jp_fetch, jp_ws_fetch, jp_http_port, jp_auth_header):
4136 ws .close ()
4237
4338
44- @pytest .mark .asyncio
4539async def test_authorizer (jp_server_authorizer , jp_serverapp , jp_base_url ):
4640 auth : Authorizer = jp_server_authorizer (parent = jp_serverapp )
4741 assert isinstance (auth , Authorizer )
@@ -56,7 +50,6 @@ async def test_authorizer(jp_server_authorizer, jp_serverapp, jp_base_url):
5650 assert auth .match_url_to_resource ("/api/shutdown" ) == "server"
5751
5852
59- @pytest .mark .asyncio
6053async def test_create_notebook (jp_create_notebook ):
6154 nb = jp_create_notebook ("foo.ipynb" )
6255 assert "nbformat" in nb
0 commit comments