mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-23 03:06:55 -04:00
fix: Fix mercury extractor test
This commit is contained in:
parent
2bf496e7e9
commit
46b9e3d536
7 changed files with 79 additions and 108 deletions
|
@ -10,6 +10,12 @@ def index():
|
|||
|
||||
@route("/static/<filename>")
|
||||
def static_path(filename):
|
||||
template_path = abspath(getcwd()) / Path("tests/mock_server/templates")
|
||||
response = static_file(filename, root=template_path)
|
||||
return response
|
||||
|
||||
@route("/static_no_content_type/<filename>")
|
||||
def static_no_content_type(filename):
|
||||
template_path = abspath(getcwd()) / Path("tests/mock_server/templates")
|
||||
response = static_file(filename, root=template_path)
|
||||
response.set_header("Content-Type", "")
|
||||
|
|
|
@ -5,6 +5,6 @@ def test_download_url_downloads_content():
|
|||
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")
|
||||
text = util.download_url("http://127.0.0.1:8080/static_no_content_type/shift_jis.html")
|
||||
assert "鹿児島のニュース|MBC南日本放送" in text
|
||||
assert "掲載された全ての記事・画像等の無断転載、二次利用をお断りいたします" in text
|
Loading…
Add table
Add a link
Reference in a new issue