示例#1
0
 def test_saveurl_throttle_resume_complete(self):
     self.make_resume_file(self.filename_orig, self.filename_save)
     assert os.path.isfile(self.filename_save)
     assert os.path.getsize(self.filename_save) == os.path.getsize(
         self.filename_orig)
     timestart = time.time()
     saveurl(self.url, self.filename_save, bandwidth=500, numthreads=1)
     finishtime = time.time() - timestart
     assert self.md5(self.filename_orig) == self.md5(self.filename_save)
示例#2
0
 def test_saveurl_throttle_multiple_resume_larger(self):
     self.make_resume_file(self.filename_orig,
                           self.filename_save,
                           enlarge=True)
     assert os.path.isfile(self.filename_save)
     assert os.path.getsize(self.filename_save) > os.path.getsize(
         self.filename_orig)
     timestart = time.time()
     saveurl(self.url, self.filename_save, bandwidth=500, numthreads=16)
     finishtime = time.time() - timestart
     assert self.md5(self.filename_orig) == self.md5(self.filename_save)
示例#3
0
 def test_saveurl_throttle_multiple(self):
     timestart = time.time()
     saveurl(self.url, self.filename_save, bandwidth=500, numthreads=16)
     finishtime = time.time() - timestart
     assert finishtime > 15 and finishtime < 25
     assert self.md5(self.filename_orig) == self.md5(self.filename_save)
示例#4
0
 def test_saveurl_multiple(self):
     saveurl(self.url, self.filename_save, numthreads=16)
     assert self.md5(self.filename_orig) == self.md5(self.filename_save)