Skip to content

Commit aa99ea0

Browse files
committed
Fixed handler, and unit tests
1 parent 6a8bfd0 commit aa99ea0

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

jupyter_ai_router/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async def _get_chat(self, room_id: str):
9999
self.log.error(f"Error getting chat document for {room_id}: {e}")
100100
return None
101101

102-
def stop_extension(self):
102+
async def stop_extension(self):
103103
"""Clean up router when extension stops."""
104104
try:
105105
if hasattr(self, "router"):

jupyter_ai_router/tests/test_handlers.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55
and does not expose HTTP endpoints.
66
"""
77

8-
def test_no_handlers():
9-
"""Test that extension loads without HTTP handlers."""
10-
from jupyter_ai_router.extension import RouterExtension
11-
12-
ext = RouterExtension()
13-
assert ext.handlers == []
8+
import json
9+
10+
async def test_get_health(jp_fetch):
11+
# When
12+
response = await jp_fetch("jupyter-ai-router", "health")
13+
14+
# Then
15+
assert response.code == 200
16+
payload = json.loads(response.body)
17+
assert payload == {
18+
"data": "JupyterLab extension @jupyter-ai/router is activated!"
19+
}

0 commit comments

Comments
 (0)