Skip to content

Commit

Permalink
tests: fix downloads after change in httpbun (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar committed Apr 22, 2024
1 parent a1e5e94 commit f84e648
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/downloads_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ def test_fetch():
url = 'https://httpbun.com/status/200'
for no_ssl in (True, False):
response = _send_urllib_request('https://httpbun.com/status/200', no_ssl, True, DEFAULT_CONFIG)
assert response.data == b''
assert b"200" in response.data and b"OK" in response.data # JSON
assert response.headers["x-powered-by"].startswith("httpbun")
if pycurl is not None:
response1 = _send_pycurl_request('https://httpbun.com/status/200', True, True, DEFAULT_CONFIG)
assert response1.headers["x-powered-by"].startswith("httpbun")
assert _handle_response(url, response1, False, DEFAULT_CONFIG) == _handle_response(url, response, False, DEFAULT_CONFIG)
assert _handle_response(url, response1, False, DEFAULT_CONFIG).data == _handle_response(url, response, False, DEFAULT_CONFIG).data
assert _handle_response(url, response1, True, DEFAULT_CONFIG) == _handle_response(url, response, True, DEFAULT_CONFIG)
# response object
# too large response object
Expand Down Expand Up @@ -201,7 +201,7 @@ def test_queue():
options = _args_to_extractor(args)
options.config['DEFAULT']['SLEEP_TIME'] = '0.2'
results = download_queue_processing(url_store, args, None, options)
assert len(results[0]) == 6 and results[1] is None
assert len(results[0]) == 5 and results[1] is None


if __name__ == '__main__':
Expand Down

0 comments on commit f84e648

Please sign in to comment.