island: Consolidate tests for consts.py

This commit is contained in:
Mike Salvatore 2021-06-03 19:39:43 -04:00
parent 5ecc02d553
commit e57e28a97f
2 changed files with 11 additions and 12 deletions

View File

@ -1,5 +1,16 @@
import platform
from monkey_island.cc.server_utils import consts
def test_monkey_island_abs_path():
assert consts.MONKEY_ISLAND_ABS_PATH.endswith("monkey_island")
def test_default_server_config_file_path():
if platform.system() == "Windows":
server_file_path = f"{consts.MONKEY_ISLAND_ABS_PATH}\\cc\\{consts.SERVER_CONFIG_FILENAME}"
else:
server_file_path = f"{consts.MONKEY_ISLAND_ABS_PATH}/cc/{consts.SERVER_CONFIG_FILENAME}"
assert consts.DEFAULT_SERVER_CONFIG_PATH == server_file_path

View File

@ -1,12 +0,0 @@
import platform
import monkey_island.cc.server_utils.consts as consts
def test_default_server_config_file_path():
if platform.system() == "Windows":
server_file_path = f"{consts.MONKEY_ISLAND_ABS_PATH}\\cc\\{consts.SERVER_CONFIG_FILENAME}"
else:
server_file_path = f"{consts.MONKEY_ISLAND_ABS_PATH}/cc/{consts.SERVER_CONFIG_FILENAME}"
assert consts.DEFAULT_SERVER_CONFIG_PATH == server_file_path