浏览代码

fix: add sleep before upload to make sure the last_edit_date is different from the old last_edit_date

trgiangdo 10 月之前
父节点
当前提交
e233f5ffd5

+ 2 - 0
tests/core/data/test_csv_data_node.py

@@ -190,6 +190,8 @@ class TestCSVDataNode:
         old_last_edit_date = dn.last_edit_date
 
         upload_content = pd.read_csv(csv_file)
+
+        sleep(0.1)
         dn._upload(csv_file)
 
         assert_frame_equal(dn.read(), upload_content)  # The content of the dn should change to the uploaded content

+ 2 - 0
tests/core/data/test_excel_data_node.py

@@ -385,6 +385,8 @@ class TestExcelDataNode:
         old_last_edit_date = dn.last_edit_date
 
         upload_content = pd.read_excel(excel_file)
+
+        sleep(0.1)
         dn._upload(excel_file)
 
         assert_frame_equal(dn.read()["Sheet1"], upload_content)  # The data of dn should change to the uploaded content

+ 2 - 0
tests/core/data/test_json_data_node.py

@@ -390,6 +390,8 @@ class TestJSONDataNode:
 
         with open(json_file, "r") as f:
             upload_content = json.load(f)
+
+        sleep(0.1)
         dn._upload(json_file)
 
         assert dn.read() == upload_content  # The content of the dn should change to the uploaded content

+ 2 - 0
tests/core/data/test_parquet_data_node.py

@@ -247,6 +247,8 @@ class TestParquetDataNode:
         old_last_edit_date = dn.last_edit_date
 
         upload_content = pd.read_parquet(parquet_file_path)
+
+        sleep(0.1)
         dn._upload(parquet_file_path)
 
         assert_frame_equal(dn.read(), upload_content)  # The content of the dn should change to the uploaded content

+ 2 - 0
tests/core/data/test_pickle_data_node.py

@@ -213,6 +213,8 @@ class TestPickleDataNodeEntity:
         old_last_edit_date = dn.last_edit_date
 
         upload_content = pd.read_pickle(pickle_file_path)
+
+        sleep(0.1)
         dn._upload(pickle_file_path)
 
         assert_frame_equal(dn.read(), upload_content)  # The content of the dn should change to the uploaded content