mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 03:08:14 +00:00
Fix tests.
This commit is contained in:
parent
e428865d19
commit
500b5b0b65
@ -27,6 +27,7 @@ import sys
|
|||||||
import aiohttp
|
import aiohttp
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
sys._called_from_test = True
|
sys._called_from_test = True
|
||||||
@ -200,6 +201,8 @@ def controller_config_path(tmpdir):
|
|||||||
def controller(tmpdir, controller_config_path):
|
def controller(tmpdir, controller_config_path):
|
||||||
Controller._instance = None
|
Controller._instance = None
|
||||||
controller = Controller.instance()
|
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_file = controller_config_path
|
||||||
controller._config_loaded = True
|
controller._config_loaded = True
|
||||||
return controller
|
return controller
|
||||||
|
Loading…
Reference in New Issue
Block a user