def test_compress_and_encrypt(self): add_public_gpg() self.command.backup_mediafiles(encrypt=True, compress=True) self.assertEqual(1, len(HANDLED_FILES['written_files'])) outputfile = HANDLED_FILES['written_files'][0][1] outputfile.seek(0) self.assertTrue(outputfile.read().startswith(b'-----BEGIN PGP MESSAGE-----'))
def setUp(self): self.path = tempfile.mktemp() with open(self.path, 'a') as fd: fd.write('foo') add_public_gpg()
def setUp(self): HANDLED_FILES.clean() add_public_gpg() add_private_gpg() open(TEST_DATABASE['NAME'], 'a').close()
def setUp(self): HANDLED_FILES.clean() add_public_gpg()
def test_encrypt(self): add_public_gpg() self.command.encrypt = True self.command.save_new_backup(TEST_DATABASE)
def setUp(self): self.path = '/tmp/foo' with open(self.path, 'a') as fd: fd.write('foo') add_public_gpg()
def setUp(self): HANDLED_FILES.clean() add_public_gpg() add_private_gpg() open(TEST_DATABASE['NAME'], 'a').close() self.instance = models.CharModel.objects.create(field='foo')
def setUp(self): self.path = "/tmp/foo" with open(self.path, "a") as fd: fd.write("foo") add_public_gpg()