mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-13 20:08:55 +00:00
Add a test
This commit is contained in:
parent
fbc04e083b
commit
df654b40ff
@ -202,6 +202,7 @@ class Project:
|
||||
|
||||
@asyncio.coroutine
|
||||
def delete(self):
|
||||
yield from self.close()
|
||||
for compute in self._project_created_on_compute:
|
||||
yield from compute.delete("/projects/{}".format(self._id))
|
||||
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))
|
||||
controller.notification.emit.assert_any_call("link.deleted", link.__json__())
|
||||
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