def METHOD_NAME(self, app, cache_dir):
    with tmp_image((256, 256), format="jpeg") as img:
        expected_req = (
            {
                "path": r"/service?LAYERs=foo,bar&SERVICE=WMS&FORMAT=image%2Fjpeg"
                "&REQUEST=GetMap&HEIGHT=91&SRS=EPSG%3A4326&styles="
                "&VERSION=1.1.1&BBOX=10,15,30,31"
                "&WIDTH=114"
            },
            {"body": img.read(), "headers": {"content-type": "image/jpeg"}},
        )
        with mock_httpd(("localhost", 42423), [expected_req]):
            self.common_map_req.params.bbox = 0, 0, 40, 40
            self.common_map_req.params.transparent = True
            resp = app.get(self.common_map_req)
            assert resp.content_type == "image/png"
            data = BytesIO(resp.body)
            assert is_png(data)
            assert Image.open(data).mode == "RGBA"
    assert cache_dir.join(
        "wms_cache_EPSG4326/03/000/000/004/000/000/002.jpeg"
    ).check()