forked from p15670423/monkey
agent: Refactor add_subdirs_to_dir in test_dir_utils.py
This commit is contained in:
parent
b643cd1edd
commit
30f88ca319
|
@ -5,14 +5,11 @@ from infection_monkey.utils.dir_utils import (
|
||||||
)
|
)
|
||||||
|
|
||||||
FILES = ["file.jpg.zip", "file.xyz", "1.tar", "2.tgz"]
|
FILES = ["file.jpg.zip", "file.xyz", "1.tar", "2.tgz"]
|
||||||
SUBDIR_1 = "subdir1"
|
SUBDIRS = ["subdir1", "subdir2"]
|
||||||
SUBDIR_2 = "subdir2"
|
|
||||||
|
|
||||||
|
|
||||||
def add_subdirs_to_dir(parent_dir):
|
def add_subdirs_to_dir(parent_dir):
|
||||||
subdir1 = parent_dir / SUBDIR_1
|
subdirs = [parent_dir / s for s in SUBDIRS]
|
||||||
subdir2 = parent_dir / SUBDIR_2
|
|
||||||
subdirs = [subdir1, subdir2]
|
|
||||||
|
|
||||||
for subdir in subdirs:
|
for subdir in subdirs:
|
||||||
subdir.mkdir()
|
subdir.mkdir()
|
||||||
|
|
Loading…
Reference in New Issue