Cleanup code for getting the default project directory

This commit is contained in:
Julien Duponchelle committed 2016-05-11 18:42:55 +02:00
1 parent a0344576ba
commit 9ccb55206d
8 files changed
+46 -63

No files matched your search

+2 -2
View File
@@ -43,9 +43,9 @@ def test_json(tmpdir):
def test_path(tmpdir):
directory = Config.instance().get_section_config("Server").get("project_directory")
directory = Config.instance().get_section_config("Server").get("projects_path")
with patch("gns3server.compute.project.Project._get_default_project_directory", return_value=directory):
with patch("gns3server.utils.path.get_default_project_directory", return_value=directory):
p = Project(project_id=str(uuid4()))
assert p.path == os.path.join(directory, p.id)
assert os.path.exists(os.path.join(directory, p.id))