mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-23 14:32:00 +00:00
定时任务小修:输入模板的字段名去掉首尾空白再存,后台通知任务的异常记日志
- 「 stat_date」原样交给运行,入口节点认不出它、必填项照样报缺:保存时去掉首尾空白,去掉后重名的拦下 - 通知扫描是另起的后台任务、没人 await:出错时异常留在任务里,只会在回收时冒出一句「从未取回的异常」。 包一层,出错记日志,下一拍照常
This commit is contained in:
@@ -124,6 +124,13 @@ def test_bad_templates_explain_in_chinese(template, fragments):
|
||||
assert fragment in str(caught.value), str(caught.value)
|
||||
|
||||
|
||||
def test_field_names_are_trimmed_and_unique():
|
||||
assert service.check_template({" stat_date ": "{{ schedule.yesterday }}"}) == {"stat_date": "{{ schedule.yesterday }}"}
|
||||
with pytest.raises(TemplateError) as caught:
|
||||
service.check_template({"stat_date": "a", "stat_date ": "b"})
|
||||
assert "stat_date" in str(caught.value) and "两次" in str(caught.value)
|
||||
|
||||
|
||||
def test_variable_catalog():
|
||||
items = service.variables(datetime(2026, 10, 5, 1, 0, tzinfo=UTC), "Asia/Shanghai")
|
||||
names = [i["name"] for i in items]
|
||||
|
||||
Reference in New Issue
Block a user