refactor(api): Remove unused method

This commit is contained in:
QuantumGhost
2026-01-27 18:18:51 +08:00
parent 69a1acbef6
commit 86d34214c1
3 changed files with 1 additions and 29 deletions

View File

@ -80,10 +80,6 @@ class EmailDeliveryConfig(BaseModel):
"""Replace the url placeholder with provided value."""
return body.replace(cls.URL_PLACEHOLDER, url or "")
def body_with_url(self, url: str | None) -> str:
"""Return body content with url placeholder replaced."""
return self.render_body_template(body=self.body, url=url)
@classmethod
def render_body_template(
cls,

View File

@ -4,7 +4,7 @@ from unittest.mock import MagicMock
import pytest
import core.app.apps.common.workflow_response_converter as workflow_response_converter
from core.app.apps.common import workflow_response_converter
from core.app.apps.common.workflow_response_converter import WorkflowResponseConverter
from core.app.apps.workflow.app_runner import WorkflowAppRunner
from core.app.entities.app_invoke_entities import InvokeFrom

View File

@ -2,30 +2,6 @@ from core.workflow.nodes.human_input.entities import EmailDeliveryConfig, EmailR
from core.workflow.runtime import VariablePool
def test_replace_url_placeholder_with_value():
config = EmailDeliveryConfig(
recipients=EmailRecipients(),
subject="Subject",
body="Click here {{#url#}} to open.",
)
result = config.body_with_url("https://example.com/link")
assert result == "Click here https://example.com/link to open."
def test_replace_url_placeholder_missing_value():
config = EmailDeliveryConfig(
recipients=EmailRecipients(),
subject="Subject",
body="No link {{#url#}} available.",
)
result = config.body_with_url(None)
assert result == "No link available."
def test_render_body_template_replaces_variable_values():
config = EmailDeliveryConfig(
recipients=EmailRecipients(),