mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Update project API
This commit is contained in:
9 files changed
+74
-54
No files matched your search
@@ -62,6 +62,16 @@ def test_json(tmpdir):
|
||||
assert p.__json__() == {"name": "Test", "project_id": p.id, "path": p.path, "status": "opened", "filename": "Test.gns3"}
|
||||
|
||||
|
||||
def test_update(controller, async_run):
|
||||
project = Project(controller=controller, name="Hello")
|
||||
controller._notification = MagicMock()
|
||||
|
||||
assert project.name == "Hello"
|
||||
async_run(project.update(name="World"))
|
||||
assert project.name == "World"
|
||||
controller.notification.emit.assert_any_call("project.updated", project.__json__())
|
||||
|
||||
|
||||
def test_path(tmpdir):
|
||||
|
||||
directory = Config.instance().get_section_config("Server").get("projects_path")
|
||||
|
||||
@@ -97,7 +97,6 @@ def test_restore(project, controller, async_run):
|
||||
# project.closed notification should not be send when restoring snapshots
|
||||
assert "project.closed" not in [c[0][0] for c in controller.notification.emit.call_args_list]
|
||||
|
||||
|
||||
project = controller.get_project(project.id)
|
||||
assert not os.path.exists(test_file)
|
||||
assert len(project.nodes) == 1
|
||||
Reference in new issue
Block a user