1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-12 19:38:57 +00:00

Fix tests.

This commit is contained in:
grossmj 2020-01-08 06:03:31 +08:00
parent e428865d19
commit 500b5b0b65

View File

@ -27,6 +27,7 @@ import sys
import aiohttp
from aiohttp import web
from unittest.mock import patch
from pathlib import Path
sys._called_from_test = True
@ -200,6 +201,8 @@ def controller_config_path(tmpdir):
def controller(tmpdir, controller_config_path):
Controller._instance = None
controller = Controller.instance()
os.makedirs(os.path.dirname(controller_config_path), exist_ok=True)
Path(controller_config_path).touch()
controller._config_file = controller_config_path
controller._config_loaded = True
return controller