mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-19 20:55:14 +02:00
Extract the notification part of controller to a dedicated class
This commit is contained in:
10 files changed
+162
-106
No files matched your search
@@ -160,13 +160,13 @@ def test_connectNotification(compute, async_run):
|
||||
response.tp = aiohttp.MsgType.closed
|
||||
return response
|
||||
|
||||
compute._controller = MagicMock()
|
||||
compute._controller._notifications = MagicMock()
|
||||
compute._session = AsyncioMagicMock(return_value=ws_mock)
|
||||
compute._session.ws_connect = AsyncioMagicMock(return_value=ws_mock)
|
||||
ws_mock.receive = receive
|
||||
async_run(compute._connect_notification())
|
||||
|
||||
compute._controller.emit.assert_called_with('test', {'a': 1}, compute_id=compute.id, project_id='42')
|
||||
compute._controller.notification.emit.assert_called_with('test', {'a': 1}, compute_id=compute.id, project_id='42')
|
||||
assert compute._connected is False
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user