MCPcopy Create free account
hub / github.com/Kaggle/docker-python / TestJupyterLabLsp

Class TestJupyterLabLsp

tests/test_jupyterlab_lsp.py:8–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6# Adapted from:
7# https://github.com/jupyter-lsp/jupyterlab-lsp/blob/ce76fab170feea506faf9ef47e4bd6a468c24313/python_packages/jupyter_lsp/jupyter_lsp/tests/test_extension.py
8class TestJupyterLabLsp(unittest.TestCase):
9 def test_serverextension_path(self):
10 import jupyter_lsp
11 paths = jupyter_lsp._jupyter_server_extension_paths()
12 for path in paths:
13 self.assertTrue(__import__(path["module"]))
14
15
16 def test_serverextension(self):
17 app = ServerApp()
18 app.initialize(
19 ["--ServerApp.jpserver_extensions={'jupyter_lsp.serverextension': True}"],
20 new_httpserver=False,
21 )
22 self.assertTrue(app.language_server_manager)
23
24 found_lsp = False
25 for r in app.web_app.default_router.rules:
26 for rr in r.target.rules:
27 if "/lsp/" in str(rr.matcher.regex):
28 found_lsp = True
29
30 self.assertTrue(found_lsp, "didn't install the /lsp/ route")
31 app.stop()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected