Update project API

This commit is contained in:
Julien Duponchelle committed 2016-08-15 16:44:09 +02:00
1 parent 431bd789cb
commit 3ca4edef93
9 files changed
+74 -54

No files matched your search

+10
View File
@@ -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")
-1
View File
@@ -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