Chore/remove python dependencies selector (#7494)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user