renamed unittest test_multivol_compress to test_compress_single (compresses to single...
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 9 Jun 2016 16:01:12 +0000 (18:01 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 15 Jun 2016 11:18:03 +0000 (13:18 +0200)
testing/test_multivol.py

index ac5d2fa..e452d4a 100644 (file)
@@ -232,8 +232,8 @@ class MultivolGnuFormatTest(BaseTest):
                                   max_volume_size=30000,
                                   new_volume_handler=new_volume_handler)
 
-    def test_multivol_compress(self):
-        ''' check creation of multiple volume when compression is on '''
+    def test_compress_single(self):
+        ''' check creation of single volume when compression is on '''
 
         # create the content of the file to compress and hash it
         hash = self.create_file("big", 50000)
@@ -249,12 +249,12 @@ class MultivolGnuFormatTest(BaseTest):
         tarobj.list()
         tarobj.close()
 
-        # check that the tar volumes were correctly created
+        # data fits into a single volume -- check that no second is created
         assert os.path.exists("sample.tar.gz")
-        assert os.path.exists("sample.tar.gz.1")
-        assert not os.path.exists("sample.tar.gz.2")
+        assert not os.path.exists("sample.tar.gz.1")
 
-        # TODO: check size of first tar!
+        # check size of first volume
+        assert 330 < os.stat("sample.tar.gz").st_size < 350
 
         os.unlink("big")
         assert not os.path.exists("big")
@@ -263,7 +263,7 @@ class MultivolGnuFormatTest(BaseTest):
         print('unpacking:')
         import subprocess
         output = subprocess.check_output(
-            "tar xvfM sample.tar.gz --file=sample.tar.gz.1".split(),
+            "tar xvf sample.tar.gz".split(),
             universal_newlines=True)
         for line in output.splitlines():
             print(line.rstrip())