浏览代码

sparse test: test for transformation of all-zero blocks into CH_ALLOC chunks

Thomas Waldmann 1 周之前
父节点
当前提交
9f73862d51
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/borg/testsuite/chunker_pytest_test.py

+ 5 - 3
src/borg/testsuite/chunker_pytest_test.py

@@ -427,11 +427,13 @@ def test_filefmapreader_with_real_sparse_file(tmpdir):
         {"data_type": bytes, "allocation": CH_DATA, "size": BS},
     ]
 
-    # Expected chunks when reading with sparse=False
+    # Expected chunks when reading with sparse=False.
+    # Even though it is not differentiating data vs hole ranges, it still
+    # transforms detected all-zero blocks to CH_ALLOC chunks.
     expected_chunks_non_sparse = [
         {"data_type": bytes, "allocation": CH_DATA, "size": BS},
-        {"data_type": bytes, "allocation": CH_DATA, "size": BS},
-        {"data_type": bytes, "allocation": CH_DATA, "size": BS},
+        {"data_type": type(None), "allocation": CH_ALLOC, "size": BS},
+        {"data_type": type(None), "allocation": CH_ALLOC, "size": BS},
         {"data_type": bytes, "allocation": CH_DATA, "size": BS},
     ]