Add test for unicode char in images path

Ref #401
This commit is contained in:
Julien Duponchelle committed 2016-01-26 15:32:40 +01:00
1 parent ee2104ba35
commit 119a2a3b66
4 files changed
+16 -12

No files matched your search

+4 -2
View File
@@ -147,7 +147,9 @@ def run_around_tests(monkeypatch, port_manager):
port_manager._instance = port_manager
config = Config.instance()
config.clear()
config.set("Server", "project_directory", tmppath)
os.makedirs(os.path.join(tmppath, 'projects'))
config.set("Server", "project_directory", os.path.join(tmppath, 'projects'))
config.set("Server", "images_path", os.path.join(tmppath, 'images'))
config.set("Server", "auth", False)
# Prevent executions of the VM if we forgot to mock something
@@ -158,7 +160,7 @@ def run_around_tests(monkeypatch, port_manager):
# Force turn off KVM because it's not available on CI
config.set("Qemu", "enable_kvm", False)
monkeypatch.setattr("gns3server.modules.project.Project._get_default_project_directory", lambda *args: tmppath)
monkeypatch.setattr("gns3server.modules.project.Project._get_default_project_directory", lambda *args: os.path.join(tmppath, 'projects'))
# Force sys.platform to the original value. Because it seem not be restore correctly at each tests
sys.platform = sys.original_platform