From 3098ac1459f841aaead2d587beda14c44bdef8b5 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Mon, 24 May 2021 12:25:10 +0300 Subject: [PATCH] Fixed a failing environment setup in unit tests --- monkey/monkey_island/cc/models/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/models/__init__.py b/monkey/monkey_island/cc/models/__init__.py index a46e5bd76..9b244a974 100644 --- a/monkey/monkey_island/cc/models/__init__.py +++ b/monkey/monkey_island/cc/models/__init__.py @@ -2,11 +2,12 @@ from mongoengine import connect # Needed so that a server_config.json file exists at the default path, # otherwise, unit tests will error while importing `env_singleton` below. -from monkey_island.cc.environment.server_config_generator import ( # noqa: E402 - create_default_server_config_file, -) +from monkey_island.cc.environment import data_dir_generator, server_config_handler # noqa: E402 -create_default_server_config_file() +from ..server_utils.consts import DEFAULT_DATA_DIR + +data_dir_generator.create_data_dir(DEFAULT_DATA_DIR, False) +server_config_handler.create_default_server_config_file() import monkey_island.cc.environment.environment_singleton as env_singleton # noqa: E402