add unittest that runs one of the many multivolume compression size tests
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Tue, 14 Jun 2016 10:28:32 +0000 (12:28 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 15 Jun 2016 11:18:03 +0000 (13:18 +0200)
testing/test_multivol.py

index 60ba20a..3de65a1 100644 (file)
 
 
 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):
     """