diff --git a/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py b/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py index 8a08a4595..37af9509e 100644 --- a/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py +++ b/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py @@ -244,3 +244,16 @@ def test_readme_already_exists( ).run_payload() mock_copy_file.assert_not_called() + + +def test_no_readme_if_no_directory( + build_ransomware_payload, ransomware_payload_config, ransomware_target +): + ransomware_payload_config["encryption"]["enabled"] = True + ransomware_payload_config["encryption"]["directories"]["linux_target_dir"] = "" + ransomware_payload_config["encryption"]["directories"]["windows_target_dir"] = "" + ransomware_payload_config["other_behaviors"]["readme"] = True + ransomware_payload = build_ransomware_payload(ransomware_payload_config) + + ransomware_payload.run_payload() + assert not Path(ransomware_target / README_DEST).exists()