Chore/remove python dependencies selector (#7494)

This commit is contained in:
Yeuoly 2024-08-21 16:57:14 +08:00 • committed by GitHub
commit 784b11ce19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 21 additions and 388 deletions

View file

@ -6,14 +6,13 @@ from _pytest.monkeypatch import MonkeyPatch
from jinja2 import Template
from core.helper.code_executor.code_executor import CodeExecutor, CodeLanguage
from core.helper.code_executor.entities import CodeDependency
MOCK = os.getenv('MOCK_SWITCH', 'false') == 'true'
class MockedCodeExecutor:
@classmethod
def invoke(cls, language: Literal['python3', 'javascript', 'jinja2'],
code: str, inputs: dict, dependencies: Optional[list[CodeDependency]] = None) -> dict:
code: str, inputs: dict) -> dict:
# invoke directly
match language:
case CodeLanguage.PYTHON3:
@ -24,6 +23,8 @@ class MockedCodeExecutor:
return {
"result": Template(code).render(inputs)
}
case _:
raise Exception("Language not supported")
@pytest.fixture
def setup_code_executor_mock(request, monkeypatch: MonkeyPatch):