Extract the notification part of controller to a dedicated class

This commit is contained in:
Julien Duponchelle committed 2016-05-18 14:56:23 +02:00
1 parent d86cefaaeb
commit 694e1a2e68
10 files changed
+162 -106

No files matched your search

+2 -2
View File
@@ -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