소스 검색

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

Thomas Waldmann 3 주 전
부모
커밋
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},
     ]