import json
from datetime import datetime
from functools import partial
+from unittest import skip, SkipTest
from deltatar.tarfile import TarFile, GNU_FORMAT
from deltatar.deltatar import DeltaTar, NO_MATCH, MATCH, PARENT_MATCH
restore it.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
'''
# this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
'''
Restores a full backup using an index file.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
'''
Restores a full multivolume backup using an index file.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
'''
Creates a backup, and then filter when doing the index based restore.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
Creates a backup, and then filter when doing the index based restore,
using the filter function.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
visited_paths = []
def filter_func(visited_paths, path):
Creates a full backup, modifies some files, creates a diff backup,
then restores the diff backup from zero.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
Creates a full backup, modifies some files, creates a diff backup,
then restores the diff backup with the full backup as a starting point.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
diff backup, then restores the diff backup with the full backup as a
starting point.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
diff backup, then restores the diff backup with the full backup as a
starting point.
'''
- # this test only works for uncompressed or concat compressed modes
if self.MODE.startswith(':') or self.MODE.startswith('|'):
- return
+ raise SkipTest('this test only works for uncompressed '
+ 'or concat compressed modes')
deltatar = DeltaTar(mode=self.MODE, password=self.PASSWORD,
logger=self.consoleLogger)
'''
MODE = '|gz'
-# Commenting Bz2 tests, they are too slow..
-#class DeltaTarBz2Test(DeltaTarTest):
- #'''
- #Same as DeltaTar but with specific bz2 mode
- #'''
- #MODE = ':bz2'
+@skip('Bz2 tests are too slow..')
+class DeltaTarBz2Test(DeltaTarTest):
+ '''
+ Same as DeltaTar but with specific bz2 mode
+ '''
+ MODE = ':bz2'
-#class DeltaTarBz2StreamTest(DeltaTarTest):
- #'''
- #Same as DeltaTar but with specific bz2 stream mode
- #'''
- #MODE = '|bz2'
+
+@skip('Bz2 tests are too slow..')
+class DeltaTarBz2StreamTest(DeltaTarTest):
+ '''
+ Same as DeltaTar but with specific bz2 stream mode
+ '''
+ MODE = '|bz2'
class DeltaTarGzipConcatTest(DeltaTarTest):