Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ameshのタイル画像取得のMockへリクエストヘッダーの条件追加 #1708

Merged
merged 6 commits into from
Nov 27, 2022
10 changes: 7 additions & 3 deletions tests/plugins/test_hato.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,15 @@ def get_amesh_test(
os.path.join(os.path.dirname(__file__), "test.png"), mode="rb"
) as picture_file:
image_content = picture_file.read()
for image_url in [
mocker.get(
re.compile(r"www\.jma\.go\.jp/bosai/jmatile/data/nowc/.+\.png"),
content=image_content,
)
mocker.get(
re.compile(r"tile\.openstreetmap\.org/.+\.png"),
]:
mocker.get(image_url, content=image_content)
request_headers={"user-agent": f"hato-bot/{conf.VERSION}"},
content=image_content,
)

with open(
os.path.join(os.path.dirname(__file__), "test_targetTimes_N1.json"),
Expand Down