From: Philipp Gesang Date: Mon, 14 Aug 2017 10:09:28 +0000 (+0200) Subject: allow for numbers of missing and failed files to differ in recovery test X-Git-Tag: v2.2~7^2~72 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=4d4925de7397aabed8b5f743f66ff83fa6f724ec;p=python-delta-tar allow for numbers of missing and failed files to differ in recovery test --- diff --git a/testing/test_recover.py b/testing/test_recover.py index 8378afc..e2a6292 100644 --- a/testing/test_recover.py +++ b/testing/test_recover.py @@ -147,6 +147,7 @@ class RecoverTest (BaseTest): MISMATCHES = 0 # files that were restored but corrupted CORRUPT = corrupt_payload_start VOLUMES = 1 + MISSING = None # normally the number of failures def setUp(self): @@ -284,7 +285,14 @@ class RecoverTest (BaseTest): mismatch.append (key) else: missing.append (key) - assert len (missing) == self.FAILURES + + # usually, an object whose extraction fails will not be found on + # disk afterwards so the number of failures equals that of missing + # files. however, some modes will create partial files for objects + # spanning multiple volumes that contain the parts whose checksums + # were valid. + assert len (missing) == (self.MISSING if self.MISSING is not None + else self.FAILURES) assert len (mismatch) == self.MISMATCHES shutil.rmtree (self.dst_path) @@ -452,6 +460,7 @@ class RecoverCorruptTrailingDataGZMultiTest (RecoverCorruptTrailingDataGZTestBas # the object is recreated from the first header of the second volume, # containing only the remainder of the data. MISMATCHES = 1 + MISSING = 0 class RecoverCorruptTrailingDataGZAESTestBase (RecoverTest):