From 2795b96993d9d1e6dbcc3c74e159a38d4cec20d5 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Tue, 14 Jun 2016 12:28:32 +0200 Subject: [PATCH] add unittest that runs one of the many multivolume compression size tests --- testing/test_multivol.py | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/testing/test_multivol.py b/testing/test_multivol.py index 60ba20a..3de65a1 100644 --- a/testing/test_multivol.py +++ b/testing/test_multivol.py @@ -16,10 +16,12 @@ import os +from tempfile import TemporaryDirectory from deltatar.tarfile import TarFile, PAX_FORMAT, GNU_FORMAT, BLOCKSIZE from . import BaseTest, new_volume_handler, closing_new_volume_handler from .create_pseudo_random_files import create_file as create_random_file +from .test_multivol_compression_sizes import test as multivol_compr_test_func class MultivolGnuFormatTest(BaseTest): """ @@ -742,6 +744,27 @@ class MultivolGnuFormatTest(BaseTest): assert os.path.exists("big") assert hash != self.md5sum("big") + def test_multivol_compress_vol_size(self): + """ test size of compressed volumes using "external" test routine + + created an extensive test of this in extra file, run here just 2 short + versions + """ + # params + vol_size = 3 # MB + input_size_factor = 3 # --> add 3*3 MB of data + modes = 'w#gz', 'w#gz.aes128' + debug_level = 0 # no debug output + clean_up_if_error = True # leave no files behind + + with TemporaryDirectory(prefix='deltatar_test_multivol_') \ + as temp_dir: # is deleted automatically after test + for mode in modes: + multivol_compr_test_func(vol_size, input_size_factor, mode, + temp_dir, + debug_level=debug_level, + clean_up_if_error=clean_up_if_error) + class MultivolPaxFormatTest(MultivolGnuFormatTest): """ -- 1.7.1