mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-21 21:45:20 +02:00
The server has now 2 notification streams
* A new one for controller related events (compute, appliance templates etc.) * The existing one for project related events (links, nodes etc.)
This commit is contained in:
1 parent
dac3ba19b7
commit
7f72b90b0e
364 files changed
+12364
-9923
No files matched your search
@@ -111,7 +111,7 @@ def test_compute_httpQueryNotConnected(compute, controller, async_run):
|
||||
mock.assert_any_call("POST", "https://example.com:84/v2/compute/projects", data=b'{"a": "b"}', headers={'content-type': 'application/json'}, auth=None, chunked=None, timeout=20)
|
||||
assert compute._connected
|
||||
assert compute._capabilities["version"] == __version__
|
||||
controller.notification.emit.assert_called_with("compute.updated", compute.__json__())
|
||||
controller.notification.controller_emit.assert_called_with("compute.updated", compute.__json__())
|
||||
|
||||
|
||||
def test_compute_httpQueryNotConnectedGNS3vmNotRunning(compute, controller, async_run):
|
||||
@@ -135,7 +135,7 @@ def test_compute_httpQueryNotConnectedGNS3vmNotRunning(compute, controller, asyn
|
||||
assert controller.gns3vm.start.called
|
||||
assert compute._connected
|
||||
assert compute._capabilities["version"] == __version__
|
||||
controller.notification.emit.assert_called_with("compute.updated", compute.__json__())
|
||||
controller.notification.controller_emit.assert_called_with("compute.updated", compute.__json__())
|
||||
|
||||
|
||||
def test_compute_httpQueryNotConnectedInvalidVersion(compute, async_run):
|
||||
@@ -259,7 +259,7 @@ def test_connectNotificationPing(compute, async_run):
|
||||
async_run(compute._connect_notification())
|
||||
|
||||
assert not compute._controller.notification.dispatch.called
|
||||
args, _ = compute._controller.notification.emit.call_args_list[0]
|
||||
args, _ = compute._controller.notification.controller_emit.call_args_list[0]
|
||||
assert args[0] == "compute.updated"
|
||||
assert args[1]["memory_usage_percent"] == 80.7
|
||||
assert args[1]["cpu_usage_percent"] == 35.7
|
||||
@@ -322,7 +322,7 @@ def test_update(compute, controller, async_run):
|
||||
async_run(compute.update(name="Test 2"))
|
||||
assert compute.name == "Test 2"
|
||||
assert compute.host == "example.org"
|
||||
controller.notification.emit.assert_called_with("compute.updated", compute.__json__())
|
||||
controller.notification.controller_emit.assert_called_with("compute.updated", compute.__json__())
|
||||
assert compute.connected is False
|
||||
assert compute._controller.save.called
|
||||
|
||||
|
||||
Reference in new issue
Block a user