forked from p15670423/monkey
tests: Move ransomware_target() fixture to ransomware/conftest.py
This commit is contained in:
parent
45ba743418
commit
d99811f83f
|
@ -0,0 +1,13 @@
|
||||||
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def ransomware_target(tmp_path, data_for_tests_dir):
|
||||||
|
ransomware_test_data = Path(data_for_tests_dir) / "ransomware_targets"
|
||||||
|
ransomware_target = tmp_path / "ransomware_target"
|
||||||
|
shutil.copytree(ransomware_test_data, ransomware_target)
|
||||||
|
|
||||||
|
return ransomware_target
|
|
@ -1,6 +1,4 @@
|
||||||
import os
|
import os
|
||||||
import shutil
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from tests.utils import hash_file, is_user_admin
|
from tests.utils import hash_file, is_user_admin
|
||||||
|
@ -36,15 +34,6 @@ def with_extension(filename):
|
||||||
return f"{filename}{EXTENSION}"
|
return f"{filename}{EXTENSION}"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def ransomware_target(tmp_path, data_for_tests_dir):
|
|
||||||
ransomware_test_data = Path(data_for_tests_dir) / "ransomware_targets"
|
|
||||||
ransomware_target = tmp_path / "ransomware_target"
|
|
||||||
shutil.copytree(ransomware_test_data, ransomware_target)
|
|
||||||
|
|
||||||
return ransomware_target
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def ransomware_payload_config(ransomware_target):
|
def ransomware_payload_config(ransomware_target):
|
||||||
return {"linux_dir": str(ransomware_target), "windows_dir": str(ransomware_target)}
|
return {"linux_dir": str(ransomware_target), "windows_dir": str(ransomware_target)}
|
||||||
|
|
Loading…
Reference in New Issue