mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Add a test
This commit is contained in:
parent
fbc04e083b
commit
df654b40ff
@ -202,6 +202,7 @@ class Project:
|
|||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def delete(self):
|
def delete(self):
|
||||||
|
yield from self.close()
|
||||||
for compute in self._project_created_on_compute:
|
for compute in self._project_created_on_compute:
|
||||||
yield from compute.delete("/projects/{}".format(self._id))
|
yield from compute.delete("/projects/{}".format(self._id))
|
||||||
shutil.rmtree(self.path, ignore_errors=True)
|
shutil.rmtree(self.path, ignore_errors=True)
|
||||||
|
@ -218,3 +218,10 @@ def test_deleteLink(async_run, project, controller):
|
|||||||
async_run(project.delete_link(link.id))
|
async_run(project.delete_link(link.id))
|
||||||
controller.notification.emit.assert_any_call("link.deleted", link.__json__())
|
controller.notification.emit.assert_any_call("link.deleted", link.__json__())
|
||||||
assert len(project._links) == 0
|
assert len(project._links) == 0
|
||||||
|
|
||||||
|
|
||||||
|
def test_delete(async_run, project, controller):
|
||||||
|
assert os.path.exists(project.path)
|
||||||
|
async_run(project.delete())
|
||||||
|
assert not os.path.exists(project.path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user