Disallow creating project with " in the path

It's not supported by dynamips.

Fix https://github.com/GNS3/gns3-gui/issues/987
This commit is contained in:
Julien Duponchelle committed 2016-02-04 11:47:48 +01:00
1 parent 4f61443b20
commit 5bee927481
2 files changed
+11 -1

No files matched your search

+7
View File
@@ -102,6 +102,13 @@ def test_changing_path_not_allowed(tmpdir):
p.path = str(tmpdir)
def test_changing_path_with_quote_not_allowed(tmpdir):
with patch("gns3server.modules.project.Project.is_local", return_value=True):
with pytest.raises(aiohttp.web.HTTPForbidden):
p = Project()
p.path = str(tmpdir / "project\"53")
def test_json(tmpdir):
p = Project()
assert p.__json__() == {"name": p.name, "location": p.location, "path": p.path, "project_id": p.id, "temporary": False}