mirror of
https://github.com/langgenius/dify.git
synced 2025-07-09 02:02:21 +00:00

This pull request introduces a feature aimed at improving the debugging experience during workflow editing. With the addition of variable persistence, the system will automatically retain the output variables from previously executed nodes. These persisted variables can then be reused when debugging subsequent nodes, eliminating the need for repetitive manual input. By streamlining this aspect of the workflow, the feature minimizes user errors and significantly reduces debugging effort, offering a smoother and more efficient experience. Key highlights of this change: - Automatic persistence of output variables for executed nodes. - Reuse of persisted variables to simplify input steps for nodes requiring them (e.g., `code`, `template`, `variable_assigner`). - Enhanced debugging experience with reduced friction. Closes #19735.
21 lines
603 B
Python
21 lines
603 B
Python
import datetime
|
|
|
|
from libs.datetime_utils import naive_utc_now
|
|
|
|
|
|
def test_naive_utc_now(monkeypatch):
|
|
tz_aware_utc_now = datetime.datetime.now(tz=datetime.UTC)
|
|
|
|
def _now_func(tz: datetime.timezone | None) -> datetime.datetime:
|
|
return tz_aware_utc_now.astimezone(tz)
|
|
|
|
monkeypatch.setattr("libs.datetime_utils._now_func", _now_func)
|
|
|
|
naive_datetime = naive_utc_now()
|
|
|
|
assert naive_datetime.tzinfo is None
|
|
assert naive_datetime.date() == tz_aware_utc_now.date()
|
|
naive_time = naive_datetime.time()
|
|
utc_time = tz_aware_utc_now.time()
|
|
assert naive_time == utc_time
|