From efcbca02a92a84360b679ef7d63b1cfefb91721b Mon Sep 17 00:00:00 2001 From: Zach Sailer Date: Mon, 12 Sep 2022 14:35:36 -0700 Subject: [PATCH] fix issues with jupyter_events 0.5.0 --- tests/services/events/mock_event.yaml | 2 +- .../events/mockextension/mock_extension.py | 2 +- .../events/mockextension/mock_extension_event.yaml | 2 +- tests/services/events/test_api.py | 14 +++++++------- tests/services/events/test_extension.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/services/events/mock_event.yaml b/tests/services/events/mock_event.yaml index 7096475eb2..dabaa23db5 100644 --- a/tests/services/events/mock_event.yaml +++ b/tests/services/events/mock_event.yaml @@ -1,4 +1,4 @@ -$id: event.mock.jupyter.org/message +$id: http://event.mock.jupyter.org/message version: 1 title: Message description: | diff --git a/tests/services/events/mockextension/mock_extension.py b/tests/services/events/mockextension/mock_extension.py index 619ec9c565..6b9f5afc4a 100644 --- a/tests/services/events/mockextension/mock_extension.py +++ b/tests/services/events/mockextension/mock_extension.py @@ -8,7 +8,7 @@ class MockEventHandler(JupyterHandler): def get(self): # Emit an event. self.event_logger.emit( - schema_id="event.mockextension.jupyter.org/message", + schema_id="http://event.mockextension.jupyter.org/message", data={"event_message": "Hello world, from mock extension!"}, ) diff --git a/tests/services/events/mockextension/mock_extension_event.yaml b/tests/services/events/mockextension/mock_extension_event.yaml index 49e963fb5f..b7c03d1a48 100644 --- a/tests/services/events/mockextension/mock_extension_event.yaml +++ b/tests/services/events/mockextension/mock_extension_event.yaml @@ -1,4 +1,4 @@ -$id: event.mockextension.jupyter.org/message +$id: http://event.mockextension.jupyter.org/message version: 1 title: Message description: | diff --git a/tests/services/events/test_api.py b/tests/services/events/test_api.py index 3d1b1800fc..017b7c942e 100644 --- a/tests/services/events/test_api.py +++ b/tests/services/events/test_api.py @@ -31,7 +31,7 @@ async def test_subscribe_websocket(event_logger, jp_ws_fetch): ws = await jp_ws_fetch("/api/events/subscribe") event_logger.emit( - schema_id="event.mock.jupyter.org/message", + schema_id="http://event.mock.jupyter.org/message", data={"event_message": "Hello, world!"}, ) # await event_logger.gather_listeners() @@ -44,7 +44,7 @@ async def test_subscribe_websocket(event_logger, jp_ws_fetch): payload_1 = """\ { - "schema_id": "event.mock.jupyter.org/message", + "schema_id": "http://event.mock.jupyter.org/message", "version": 1, "data": { "event_message": "Hello, world!" @@ -55,7 +55,7 @@ async def test_subscribe_websocket(event_logger, jp_ws_fetch): payload_2 = """\ { - "schema_id": "event.mock.jupyter.org/message", + "schema_id": "http://event.mock.jupyter.org/message", "version": 1, "data": { "event_message": "Hello, world!" @@ -83,7 +83,7 @@ async def test_post_event(jp_fetch, event_logger_sink, payload): payload_3 = """\ { - "schema_id": "event.mock.jupyter.org/message", + "schema_id": "http://event.mock.jupyter.org/message", "data": { "event_message": "Hello, world!" } @@ -101,7 +101,7 @@ async def test_post_event(jp_fetch, event_logger_sink, payload): payload_5 = """\ { - "schema_id": "event.mock.jupyter.org/message", + "schema_id": "http://event.mock.jupyter.org/message", "version": 1 } """ @@ -128,7 +128,7 @@ async def test_post_event_400(jp_fetch, event_logger, payload): payload_7 = """\ { - "schema_id": "event.mock.jupyter.org/message", + "schema_id": "http://event.mock.jupyter.org/message", "version": 1, "data": { "message": "Hello, world!" @@ -138,7 +138,7 @@ async def test_post_event_400(jp_fetch, event_logger, payload): payload_8 = """\ { - "schema_id": "event.mock.jupyter.org/message", + "schema_id": "http://event.mock.jupyter.org/message", "version": 2, "data": { "message": "Hello, world!" diff --git a/tests/services/events/test_extension.py b/tests/services/events/test_extension.py index 403c266f19..fafb34497f 100644 --- a/tests/services/events/test_extension.py +++ b/tests/services/events/test_extension.py @@ -9,7 +9,7 @@ def jp_server_config(): "ServerApp": { "jpserver_extensions": {"tests.services.events.mockextension": True}, }, - "EventBus": {"allowed_schemas": ["event.mockextension.jupyter.org/message"]}, + "EventBus": {"allowed_schemas": ["http://event.mockextension.jupyter.org/message"]}, } return config