Prevent capture on non running node

Fix https://github.com/GNS3/gns3-gui/issues/1656
This commit is contained in:
Julien Duponchelle committed 2016-11-22 16:05:57 +01:00
1 parent 31c04cc95b
commit 875051d05e
9 files changed
+158 -39

No files matched your search

+4 -4
View File
@@ -77,7 +77,7 @@ def test_dispatch(async_run, controller, project):
with notif.queue(project) as queue:
assert len(notif._listeners[project.id]) == 1
async_run(queue.get(0.1)) # ping
notif.dispatch("test", {}, compute_id=1)
async_run(notif.dispatch("test", {}, compute_id=1))
msg = async_run(queue.get(5))
assert msg == ('test', {}, {})
@@ -87,7 +87,7 @@ def test_dispatch_ping(async_run, controller, project):
with notif.queue(project) as queue:
assert len(notif._listeners[project.id]) == 1
async_run(queue.get(0.1)) # ping
notif.dispatch("ping", {}, compute_id=12)
async_run(notif.dispatch("ping", {}, compute_id=12))
msg = async_run(queue.get(5))
assert msg == ('ping', {'compute_id': 12}, {})
@@ -102,13 +102,13 @@ def test_dispatch_node_updated(async_run, controller, node, project):
with notif.queue(project) as queue:
assert len(notif._listeners[project.id]) == 1
async_run(queue.get(0.1)) # ping
notif.dispatch("node.updated", {
async_run(notif.dispatch("node.updated", {
"node_id": node.id,
"project_id": project.id,
"name": "hello",
"startup_config": "ip 192"
},
compute_id=1)
compute_id=1))
assert node.name == "hello"
action, event, _ = async_run(queue.get(5))
assert action == "node.updated"