fix prefetch -> stream because of requests upgrade (bug 864075)
This commit is contained in:
Родитель
6a476dc63c
Коммит
02be85a3d9
|
@ -155,7 +155,7 @@ def try_get_resource(err, package, url, filename, resource_type="URL",
|
|||
filename=filename)
|
||||
|
||||
try:
|
||||
request = requests.get(url, prefetch=False, allow_redirects=True,
|
||||
request = requests.get(url, stream=True, allow_redirects=True,
|
||||
timeout=3, headers=HEADERS)
|
||||
data = request.raw.read(constants.MAX_RESOURCE_SIZE)
|
||||
# Check that there's not more data than the max size.
|
||||
|
|
|
@ -100,7 +100,7 @@ class TestResourceExceptions(TestCase):
|
|||
appbase.try_get_resource(self.err, None, "/zip/zap", "")
|
||||
except DummyException:
|
||||
requests_get.assert_called_once_with(
|
||||
"ftp://test.com/zip/zap", prefetch=False,
|
||||
"ftp://test.com/zip/zap", stream=True,
|
||||
allow_redirects=True, timeout=3, headers=appbase.HEADERS)
|
||||
else:
|
||||
raise AssertionError("Should have gotten DummyException")
|
||||
|
|
Загрузка…
Ссылка в новой задаче