mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 07:23:47 +02:00
Fix tests.
This commit is contained in:
parent
e52775fa3a
commit
5d704aa478
@ -375,13 +375,13 @@ class Node:
|
|||||||
setattr(self, prop, kwargs[prop])
|
setattr(self, prop, kwargs[prop])
|
||||||
|
|
||||||
self._list_ports()
|
self._list_ports()
|
||||||
# We send notif only if object has changed
|
|
||||||
#if old_json != self.__json__():
|
|
||||||
# self.project.controller.notification.emit("node.updated", self.__json__())
|
|
||||||
if update_compute:
|
if update_compute:
|
||||||
data = self._node_data(properties=compute_properties)
|
data = self._node_data(properties=compute_properties)
|
||||||
response = yield from self.put(None, data=data)
|
response = yield from self.put(None, data=data)
|
||||||
yield from self.parse_node_response(response.json)
|
yield from self.parse_node_response(response.json)
|
||||||
|
elif old_json != self.__json__():
|
||||||
|
# We send notif only if object has changed
|
||||||
|
self.project.controller.notification.emit("node.updated", self.__json__())
|
||||||
self.project.dump()
|
self.project.dump()
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
@ -314,7 +314,7 @@ def test_update(node, compute, project, async_run, controller):
|
|||||||
assert node._console == 2048
|
assert node._console == 2048
|
||||||
assert node.x == 42
|
assert node.x == 42
|
||||||
assert node._properties == {"startup_script": "echo test"}
|
assert node._properties == {"startup_script": "echo test"}
|
||||||
controller._notification.emit.assert_called_with("node.updated", node.__json__())
|
#controller._notification.emit.assert_called_with("node.updated", node.__json__())
|
||||||
assert project.dump.called
|
assert project.dump.called
|
||||||
|
|
||||||
|
|
||||||
@ -341,9 +341,9 @@ def test_update_properties(node, compute, project, async_run, controller):
|
|||||||
|
|
||||||
# The notif should contain the old properties because it's the compute that will emit
|
# The notif should contain the old properties because it's the compute that will emit
|
||||||
# the correct info
|
# the correct info
|
||||||
node_notif = copy.deepcopy(node.__json__())
|
#node_notif = copy.deepcopy(node.__json__())
|
||||||
node_notif["properties"]["startup_script"] = "echo test"
|
#node_notif["properties"]["startup_script"] = "echo test"
|
||||||
controller._notification.emit.assert_called_with("node.updated", node_notif)
|
#controller._notification.emit.assert_called_with("node.updated", node_notif)
|
||||||
|
|
||||||
|
|
||||||
def test_update_only_controller(node, controller, compute, project, async_run):
|
def test_update_only_controller(node, controller, compute, project, async_run):
|
||||||
|
Loading…
Reference in New Issue
Block a user