示例#1
0
 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 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-----'))
示例#3
0
 def setUp(self):
     self.path = tempfile.mktemp()
     with open(self.path, 'a') as fd:
         fd.write('foo')
     add_public_gpg()
示例#4
0
 def setUp(self):
     HANDLED_FILES.clean()
     add_public_gpg()
     add_private_gpg()
     open(TEST_DATABASE['NAME'], 'a').close()
示例#5
0
 def setUp(self):
     HANDLED_FILES.clean()
     add_public_gpg()
示例#6
0
 def test_encrypt(self):
     add_public_gpg()
     self.command.encrypt = True
     self.command.save_new_backup(TEST_DATABASE)
 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()
示例#9
0
 def setUp(self):
     self.path = tempfile.mktemp()
     with open(self.path, 'a') as fd:
         fd.write('foo')
     add_public_gpg()
示例#10
0
 def setUp(self):
     self.path = '/tmp/foo'
     with open(self.path, 'a') as fd:
         fd.write('foo')
     add_public_gpg()
示例#11
0
 def setUp(self):
     self.path = '/tmp/foo'
     with open(self.path, 'a') as fd:
         fd.write('foo')
     add_public_gpg()
示例#12
0
 def test_encrypt(self):
     add_public_gpg()
     self.command.encrypt = True
     self.command.save_new_backup(TEST_DATABASE)
 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')
示例#14
0
 def setUp(self):
     self.path = "/tmp/foo"
     with open(self.path, "a") as fd:
         fd.write("foo")
     add_public_gpg()
示例#15
0
 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')