import os import tempfile import unittest from pathlib import Path from deliverable.utils.plugins import _get_plugins_from_dirs, _get_obfuscated_plugins def write_file(path: Path, content: str): path.parent.mkdir(parents=True, exist_ok=True) path.write_text(content, encoding="utf-8") class TestGetPluginsFromDirs(unittest.TestCase): def test_single_file_plugin_detected(self): with tempfile.TemporaryDirectory() as td: p = Path(td) / "plugins" p.mkdir() single = p / "hello.php" write_file( single, """