Send a project closed event when project close

Ref #602
pull/638/head
Julien Duponchelle 8 years ago
parent 225e4f7528
commit 16c2305b33
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

@ -126,6 +126,15 @@ Drawing has been deleted.
.. literalinclude:: api/notifications/drawing.deleted.json
project.closed
---------------
Project has been closed.
.. literalinclude:: api/notifications/project.closed.json
log.error
---------

@ -445,6 +445,7 @@ class Project:
yield from compute.post("/projects/{}/close".format(self._id))
self._cleanPictures()
self._status = "closed"
self.controller.notification.emit("project.closed", self.__json__())
def _cleanPictures(self):
"""

@ -332,8 +332,10 @@ def test_open_close(async_run, controller):
assert project.status == "closed"
async_run(project.open())
assert project.status == "opened"
controller._notification = MagicMock()
async_run(project.close())
assert project.status == "closed"
controller.notification.emit.assert_any_call("project.closed", project.__json__())
def test_is_running(project, async_run, node):

Loading…
Cancel
Save