projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a3e8146
)
[test_downloader_http] Use try_rm
author
Sergey M․
<dstftw@gmail.com>
Sat, 3 Feb 2018 16:24:27 +0000
(23:24 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 3 Feb 2018 16:24:27 +0000
(23:24 +0700)
test/test_downloader_http.py
patch
|
blob
|
history
diff --git
a/test/test_downloader_http.py
b/test/test_downloader_http.py
index 95d15207213214f407af11b58a8ff6a1cb05037e..5cf2bf1a56212ed1888ee5cb8728c68b01d555fa 100644
(file)
--- a/
test/test_downloader_http.py
+++ b/
test/test_downloader_http.py
@@
-9,6
+9,7
@@
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from test.helper import try_rm
from youtube_dl import YoutubeDL
from youtube_dl.compat import compat_http_server
from youtube_dl.downloader.http import HttpFD
from youtube_dl import YoutubeDL
from youtube_dl.compat import compat_http_server
from youtube_dl.downloader.http import HttpFD
@@
-100,11
+101,12
@@
class TestHttpFD(unittest.TestCase):
ydl = YoutubeDL(params)
downloader = HttpFD(ydl, params)
filename = 'testfile.mp4'
ydl = YoutubeDL(params)
downloader = HttpFD(ydl, params)
filename = 'testfile.mp4'
+ try_rm(encodeFilename(filename))
self.assertTrue(downloader.real_download(filename, {
'url': 'http://127.0.0.1:%d/%s' % (self.port, ep),
}))
self.assertEqual(os.path.getsize(encodeFilename(filename)), TEST_SIZE)
self.assertTrue(downloader.real_download(filename, {
'url': 'http://127.0.0.1:%d/%s' % (self.port, ep),
}))
self.assertEqual(os.path.getsize(encodeFilename(filename)), TEST_SIZE)
-
os.remove
(encodeFilename(filename))
+
try_rm
(encodeFilename(filename))
def download_all(self, params):
for ep in ('regular', 'no-content-length', 'no-range', 'no-range-no-content-length'):
def download_all(self, params):
for ep in ('regular', 'no-content-length', 'no-range', 'no-range-no-content-length'):