Skip to content

Commit b2a0bbc

Browse files
committed
ameshのタイル画像取得のMockへリクエストヘッダーの条件追加
1 parent 9688300 commit b2a0bbc

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/plugins/test_hato.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,9 @@ def get_amesh_test(
7878
os.path.join(os.path.dirname(__file__), "test.png"), mode="rb"
7979
) as picture_file:
8080
image_content = picture_file.read()
81-
for image_url in [
82-
re.compile(r"www\.jma\.go\.jp/bosai/jmatile/data/nowc/.+\.png"),
83-
re.compile(r"tile\.openstreetmap\.org/.+\.png"),
84-
]:
85-
mocker.get(image_url, content=image_content)
81+
mocker.get(re.compile(r"www\.jma\.go\.jp/bosai/jmatile/data/nowc/.+\.png"), content=image_content)
82+
mocker.get(re.compile(r"tile\.openstreetmap\.org/.+\.png"),
83+
request_headers={"user-agent": f"hato-bot/{conf.VERSION}"}, content=image_content)
8684

8785
with open(
8886
os.path.join(os.path.dirname(__file__), "test_targetTimes_N1.json"),

0 commit comments

Comments
 (0)