mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
parent
225e4f7528
commit
16c2305b33
@ -126,6 +126,15 @@ Drawing has been deleted.
|
|||||||
.. literalinclude:: api/notifications/drawing.deleted.json
|
.. literalinclude:: api/notifications/drawing.deleted.json
|
||||||
|
|
||||||
|
|
||||||
|
project.closed
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Project has been closed.
|
||||||
|
|
||||||
|
.. literalinclude:: api/notifications/project.closed.json
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log.error
|
log.error
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
@ -445,6 +445,7 @@ class Project:
|
|||||||
yield from compute.post("/projects/{}/close".format(self._id))
|
yield from compute.post("/projects/{}/close".format(self._id))
|
||||||
self._cleanPictures()
|
self._cleanPictures()
|
||||||
self._status = "closed"
|
self._status = "closed"
|
||||||
|
self.controller.notification.emit("project.closed", self.__json__())
|
||||||
|
|
||||||
def _cleanPictures(self):
|
def _cleanPictures(self):
|
||||||
"""
|
"""
|
||||||
|
@ -332,8 +332,10 @@ def test_open_close(async_run, controller):
|
|||||||
assert project.status == "closed"
|
assert project.status == "closed"
|
||||||
async_run(project.open())
|
async_run(project.open())
|
||||||
assert project.status == "opened"
|
assert project.status == "opened"
|
||||||
|
controller._notification = MagicMock()
|
||||||
async_run(project.close())
|
async_run(project.close())
|
||||||
assert project.status == "closed"
|
assert project.status == "closed"
|
||||||
|
controller.notification.emit.assert_any_call("project.closed", project.__json__())
|
||||||
|
|
||||||
|
|
||||||
def test_is_running(project, async_run, node):
|
def test_is_running(project, async_run, node):
|
||||||
|
Loading…
Reference in New Issue
Block a user