1
0
Fork 0
mirror of synced 2024-05-03 20:12:52 +12:00
ArchiveBox/tests/test_util.py
2020-09-23 10:34:05 -05:00

10 lines
515 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from archivebox import util
def test_download_url_downloads_content():
text = util.download_url("http://127.0.0.1:8080/static/example.com.html")
assert "Example Domain" in text
def test_download_url_gets_encoding_from_body():
text = util.download_url("http://127.0.0.1:8080/static_no_content_type/shift_jis.html")
assert "鹿児島のニュースMBC南日本放送" in text
assert "掲載された全ての記事・画像等の無断転載、二次利用をお断りいたします" in text