tests: Move ransomware_target() fixture to ransomware/conftest.py

This commit is contained in:
Mike Salvatore 2021-06-23 09:04:24 -04:00
parent 45ba743418
commit d99811f83f
2 changed files with 13 additions and 11 deletions

View File

@ -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

View File

@ -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)}