2020-07-04 05:54:21 +12:00
|
|
|
|
from archivebox import util
|
|
|
|
|
|
|
|
|
|
def test_download_url_downloads_content():
|
2020-07-18 09:55:56 +12:00
|
|
|
|
text = util.download_url("http://127.0.0.1:8080/static/example.com.html")
|
2020-07-23 03:24:08 +12:00
|
|
|
|
assert "Example Domain" in text
|
|
|
|
|
|
|
|
|
|
def test_download_url_gets_encoding_from_body():
|
|
|
|
|
text = util.download_url("http://127.0.0.1:8080/static/shift_jis.html")
|
|
|
|
|
assert "鹿児島のニュース|MBC南日本放送" in text
|
|
|
|
|
assert "掲載された全ての記事・画像等の無断転載、二次利用をお断りいたします" in text
|