diff --git a/monkey/monkey_island/cc/server_utils/consts.py b/monkey/monkey_island/cc/server_utils/consts.py index cfa426d93..13e0c66e4 100644 --- a/monkey/monkey_island/cc/server_utils/consts.py +++ b/monkey/monkey_island/cc/server_utils/consts.py @@ -1,8 +1,8 @@ import os from pathlib import Path -from monkey_island.cc.server_utils.file_utils import is_windows_os from monkey_island.cc.server_utils import file_utils +from monkey_island.cc.server_utils.file_utils import is_windows_os __author__ = "itay.mizeretz" diff --git a/monkey/monkey_island/cc/server_utils/file_utils.py b/monkey/monkey_island/cc/server_utils/file_utils.py index a495fb5f0..368f49e95 100644 --- a/monkey/monkey_island/cc/server_utils/file_utils.py +++ b/monkey/monkey_island/cc/server_utils/file_utils.py @@ -1,5 +1,5 @@ -import os import logging +import os import platform import stat diff --git a/monkey/monkey_island/cc/setup/config_setup.py b/monkey/monkey_island/cc/setup/config_setup.py index ef965e560..657ffaac5 100644 --- a/monkey/monkey_island/cc/setup/config_setup.py +++ b/monkey/monkey_island/cc/setup/config_setup.py @@ -2,9 +2,9 @@ from typing import Tuple from monkey_island.cc.arg_parser import IslandCmdArgs from monkey_island.cc.environment import server_config_handler -from monkey_island.cc.server_utils.file_utils import create_secure_directory from monkey_island.cc.server_utils import file_utils from monkey_island.cc.server_utils.consts import DEFAULT_SERVER_CONFIG_PATH +from monkey_island.cc.server_utils.file_utils import create_secure_directory from monkey_island.cc.setup.island_config_options import IslandConfigOptions diff --git a/monkey/tests/unit_tests/monkey_island/cc/server_utils/test_file_utils.py b/monkey/tests/unit_tests/monkey_island/cc/server_utils/test_file_utils.py index 4af793353..59b6f68a8 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/server_utils/test_file_utils.py +++ b/monkey/tests/unit_tests/monkey_island/cc/server_utils/test_file_utils.py @@ -1,5 +1,4 @@ import os - import stat import pytest @@ -7,8 +6,8 @@ import pytest from monkey_island.cc.server_utils.file_utils import ( create_secure_directory, create_secure_file, + expand_path, is_windows_os, - expand_path ) if is_windows_os(): @@ -19,7 +18,6 @@ if is_windows_os(): ACE_TYPE_ALLOW = 0 - def test_expand_user(patched_home_env): input_path = os.path.join("~", "test") expected_path = os.path.join(patched_home_env, "test") @@ -33,6 +31,7 @@ def test_expand_vars(patched_home_env): assert expand_path(input_path) == expected_path + @pytest.fixture def test_path_nested(tmpdir): path = os.path.join(tmpdir, "test1", "test2", "test3")