Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 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)
Exemplo n.º 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)