island: Add unit tests for expand_path()

This commit is contained in:
Mike Salvatore 2021-06-07 13:18:04 -04:00
parent 8744011297
commit bf0fe10ea9
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import os
from monkey_island.cc.server_utils import file_utils
def test_expand_user(patched_home_env):
input_path = os.path.join("~", "test")
expected_path = os.path.join(patched_home_env, "test")
assert file_utils.expand_path(input_path) == expected_path
def test_expand_vars(patched_home_env):
input_path = os.path.join("$HOME", "test")
expected_path = os.path.join(patched_home_env, "test")
assert file_utils.expand_path(input_path) == expected_path