mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Temporary project
This commit is contained in:
1 parent
7bf121c6da
commit
abc885049f
5 files changed
+74
-12
No files matched your search
@@ -58,7 +58,7 @@ def test_temporary_path():
|
||||
|
||||
def test_json(tmpdir):
|
||||
p = Project()
|
||||
assert p.__json__() == {"location": p.location, "uuid": p.uuid}
|
||||
assert p.__json__() == {"location": p.location, "uuid": p.uuid, "temporary": False}
|
||||
|
||||
|
||||
def test_vm_working_directory(tmpdir, vm):
|
||||
@@ -111,3 +111,13 @@ def test_project_close(tmpdir, manager):
|
||||
with patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM.close") as mock:
|
||||
project.close()
|
||||
assert mock.called
|
||||
|
||||
|
||||
def test_project_close_temporary_project(tmpdir, manager):
|
||||
"""A temporary project is deleted when closed"""
|
||||
|
||||
project = Project(location=str(tmpdir), temporary=True)
|
||||
directory = project.path
|
||||
assert os.path.exists(directory)
|
||||
project.close()
|
||||
assert os.path.exists(directory) is False
|
||||
Reference in new issue
Block a user