create unittest for warning
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 9 Jun 2016 09:23:09 +0000 (11:23 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 15 Jun 2016 11:18:02 +0000 (13:18 +0200)
testing/test_multivol.py

index 9896295..7afe2ef 100644 (file)
@@ -219,6 +219,15 @@ class MultivolGnuFormatTest(BaseTest):
         assert max_err < 13*1024
         assert max_err_post == 0
 
+    def test_multivol_compress_warning(self):
+        """ check warning being issued if compressing multivolume with w: """
+        with self.assertWarns(UserWarning):
+            tarobj = TarFile.open("sample.tar.gz",
+                                  mode="w:gz",
+                                  format=self.tarfile_format,
+                                  max_volume_size=30000,
+                                  new_volume_handler=new_volume_handler)
+
     def test_multivol_compress(self):
         ''' check creation of multiple volume when compression is on '''