From 0c6da6b48c39c6a438f3d393832f6072c08c9124 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 16 Oct 2022 07:16:10 +0000 Subject: [PATCH] =?UTF-8?q?format=E3=81=8C=E9=96=93=E9=81=95=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=9F=E3=81=AE=E3=81=A7=E7=9B=B4=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=82=E3=81=92=E3=81=9F=E3=82=88=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/jma_amesh.py | 10 +--------- tests/plugins/test_hato.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/library/jma_amesh.py b/library/jma_amesh.py index 9f75fa5395..22d5c04359 100644 --- a/library/jma_amesh.py +++ b/library/jma_amesh.py @@ -94,15 +94,7 @@ def get_tile_image( ) res = [] for url in urls: - res.append( - Image.open( - BytesIO( - requests.get( - url - ).content - ) - ) - ) + res.append(Image.open(BytesIO(requests.get(url).content))) dst_image = Image.new( "RGBA", (256 * (2 * around_tiles + 1), 256 * (2 * around_tiles + 1)) ) diff --git a/tests/plugins/test_hato.py b/tests/plugins/test_hato.py index f5227e6da4..eb69db3961 100644 --- a/tests/plugins/test_hato.py +++ b/tests/plugins/test_hato.py @@ -78,9 +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() - 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"), - request_headers={"user-agent": f"hato-bot/{conf.VERSION}"}, content=image_content) + 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"), + 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"),