コード例 #1
0
 def test_save_fast_resume_data_bad(self):
     # Grab the filename that will be used
     filename = generate_fast_resume_filename(FAKE_INFO_HASH)
     # Create the file
     os.makedirs(os.path.dirname(filename))
     f = open(filename, 'wb')
     f.close()
     os.chmod(filename, 0)
     save_fast_resume_data(FAKE_INFO_HASH, FAKE_RESUME_DATA)
     # We did not lock down the directory so check save_fast_resume_data
     # nuked the file for us.
     self.assertFalse(os.path.exists(filename))
コード例 #2
0
ファイル: fastresumetest.py プロジェクト: ShriramK/miro
 def test_save_fast_resume_data_bad(self):
     # Grab the filename that will be used
     filename = generate_fast_resume_filename(FAKE_INFO_HASH)
     # Create the file
     os.makedirs(os.path.dirname(filename))
     f = open(filename, 'wb')
     f.close()
     os.chmod(filename, 0)
     save_fast_resume_data(FAKE_INFO_HASH, FAKE_RESUME_DATA)
     # We did not lock down the directory so check save_fast_resume_data
     # nuked the file for us.
     self.assertFalse(os.path.exists(filename))
コード例 #3
0
 def test_resume_data(self):
     save_fast_resume_data(FAKE_INFO_HASH, FAKE_RESUME_DATA)
     data = load_fast_resume_data(FAKE_INFO_HASH)
     self.assertEquals(FAKE_RESUME_DATA, data)
コード例 #4
0
ファイル: fastresumetest.py プロジェクト: zjmmjzzjm/miro
 def test_resume_data(self):
     save_fast_resume_data(FAKE_INFO_HASH, FAKE_RESUME_DATA)
     data = load_fast_resume_data(FAKE_INFO_HASH)
     self.assertEquals(FAKE_RESUME_DATA, data)