Beispiel #1
0
 def setUp(self):
     file_fp, file_path = mkstemp()
     self.password = "******"
     self.crypto = Crypto(self.password)
     self.file_path = file_path
     self.file_entry = FileEntry.from_file(file_path, os.path.basename(file_path))
     os.close(file_fp)
Beispiel #2
0
 def setUp(self):
     file_fp, file_path = mkstemp()
     self.password = '******'
     self.crypto = Crypto(self.password)
     self.file_path = file_path
     self.file_entry = FileEntry.from_file(file_path,
                                           os.path.basename(file_path))
     os.close(file_fp)
Beispiel #3
0
 def test_from_file(self):
     stat = os.stat(self.file_path)
     d = {
         'pathname': os.path.basename(self.file_path),
         'fs_pathname': os.path.basename(self.file_path),
         'size': stat.st_size,
         'ctime': stat.st_ctime,
         'mtime': stat.st_mtime,
         'mode': stat.st_mode,
         'digest': None,
         'isdir': False,
         'salt': None
     }
     file_object = FileEntry.from_file(self.file_path, d['pathname'])
     self.assertEqual(d, file_object.to_dict())
Beispiel #4
0
 def test_from_file(self):
     stat = os.stat(self.file_path)
     d = {
         'pathname': os.path.basename(self.file_path),
         'fs_pathname': os.path.basename(self.file_path),
         'size': stat.st_size,
         'ctime': stat.st_ctime,
         'mtime': stat.st_mtime,
         'mode': stat.st_mode,
         'digest': None,
         'isdir': False,
         'salt': None
     }
     file_object = FileEntry.from_file(self.file_path, d['pathname'])
     self.assertEqual(d, file_object.to_dict())
Beispiel #5
0
 def setUp(self):
     file_fp, file_path = mkstemp()
     self.file_path = file_path
     self.file_entry = FileEntry.from_file(self.file_path, os.path.basename(
         self.file_path))
     os.close(file_fp)
Beispiel #6
0
 def setUp(self):
     file_fp, file_path = mkstemp()
     self.file_path = file_path
     self.file_entry = FileEntry.from_file(self.file_path,
                                           os.path.basename(self.file_path))
     os.close(file_fp)