Exemplo n.º 1
0
 def test_path(self, *args):
     temp_dump = get_dump()
     dump_path = mktemp()
     with open(dump_path, 'wb') as dump:
         copyfileobj(temp_dump, dump)
     self.command.path = dump.name
     self.command._restore_backup()
     self.command.decrypt = False
     self.command.filepath = get_dump_name()
     HANDLED_FILES['written_files'].append(
         (self.command.filepath, get_dump()))
     self.command._restore_backup()
Exemplo n.º 2
0
 def test_path(self, *args):
     temp_dump = get_dump()
     dump_path = mktemp()
     with open(dump_path, 'wb') as dump:
         copyfileobj(temp_dump, dump)
     self.command.path = dump.name
     self.command._restore_backup()
     self.command.decrypt = False
     self.command.filepath = get_dump_name()
     HANDLED_FILES['written_files'].append(
         (self.command.filepath, get_dump())
     )
     self.command._restore_backup()
Exemplo n.º 3
0
 def test_decrypt(self, *args):
     self.command.path = None
     self.command.decrypt = True
     encrypted_file, self.command.filename = utils.encrypt_file(
         get_dump(), get_dump_name())
     HANDLED_FILES['written_files'].append(
         (self.command.filename, encrypted_file))
     self.command._restore_backup()
Exemplo n.º 4
0
 def test_uncompress(self, *args):
     self.command.path = None
     compressed_file, self.command.filename = utils.compress_file(
         get_dump(), get_dump_name())
     HANDLED_FILES['written_files'].append(
         (self.command.filename, compressed_file))
     self.command.uncompress = True
     self.command._restore_backup()
Exemplo n.º 5
0
 def test_no_filename(self, *args):
     # Prepare backup
     HANDLED_FILES['written_files'].append(
         (utils.filename_generate('foo'), get_dump()))
     # Check
     self.command.path = None
     self.command.filename = None
     self.command._restore_backup()
Exemplo n.º 6
0
 def test_decrypt(self, *args):
     self.command.path = None
     self.command.decrypt = True
     encrypted_file, self.command.filename = utils.encrypt_file(get_dump(), get_dump_name())
     HANDLED_FILES['written_files'].append(
         (self.command.filename, encrypted_file)
     )
     self.command._restore_backup()
Exemplo n.º 7
0
 def test_uncompress(self, *args):
     self.command.path = None
     compressed_file, self.command.filename = utils.compress_file(get_dump(), get_dump_name())
     HANDLED_FILES['written_files'].append(
         (self.command.filename, compressed_file)
     )
     self.command.uncompress = True
     self.command._restore_backup()
Exemplo n.º 8
0
 def test_no_filename(self, *args):
     # Prepare backup
     HANDLED_FILES['written_files'].append(
         (utils.filename_generate('foo'), get_dump()))
     # Check
     self.command.path = None
     self.command.filename = None
     self.command._restore_backup()