瀏覽代碼

fix: output_edit_date should be get from the .last_edit_date attribute

trgiangdo 1 年之前
父節點
當前提交
71707a3b6a
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      tests/core/_orchestrator/_dispatcher/test_dispatcher__needs_to_run.py

+ 2 - 3
tests/core/_orchestrator/_dispatcher/test_dispatcher__needs_to_run.py

@@ -77,9 +77,8 @@ def test_need_to_run_skippable_task_with_validity_period_on_output():
 
 
     assert dispatcher._needs_to_run(task)  # output data is not edited
     assert dispatcher._needs_to_run(task)  # output data is not edited
 
 
-    output_edit_time = datetime.now()  # edit time
-    with freezegun.freeze_time(output_edit_time):
-        task.output["output"].write("Hello world !")  # output data is edited
+    task.output["output"].write("Hello world !")  # output data is edited
+    output_edit_time = task.output["output"].last_edit_date
 
 
     with freezegun.freeze_time(output_edit_time + timedelta(minutes=30)):  # 30 min after edit time
     with freezegun.freeze_time(output_edit_time + timedelta(minutes=30)):  # 30 min after edit time
         assert not dispatcher._needs_to_run(task)  # output data is written and validity period not expired
         assert not dispatcher._needs_to_run(task)  # output data is written and validity period not expired