def METHOD_NAME(self, request):
    # core snap is used in integration tests with fake servers.
    snap = request.matchdict["snap"]
    # tests/legacy/data/test-snap.snap
    test_sha3_384 = (
        "8c0118831680a22090503ee5db98c88dd90ef551d80fc816"
        "dec968f60527216199dacc040cddfe5cec6870db836cb908"
    )
    revision = "10000"
    confinement = "strict"
    if snap in ("snap-1", "test-snap", "core"):
        sha3_384 = test_sha3_384
    elif snap == "snapcraft":
        sha3_384 = test_sha3_384
        revision = "25"
        confinement = "classic"
    elif snap == "test-snap-with-wrong-sha":
        sha3_384 = "wrong sha"
    elif (
        snap == "test-snap-branded-store"
        and request.headers.get("Snap-Device-Store") == "Test-Branded"
    ):
        sha3_384 = test_sha3_384
    else:
        return None
    channel_map = list()
    for arch in ("amd64", "i386", "s390x", "arm64", "armhf", "ppc64el"):
        for risk in ("stable", "edge"):
            channel_map.append(
                {
                    "channel": {
                        "architecture": arch,
                        "name": risk,
                        "released-at": "019-01-17T15:01:26.537392+00:00",
                        "risk": risk,
                        "track": "latest",
                    },
                    "download": {
                        "deltas": [],
                        "sha3-384": sha3_384,
                        "url": urllib.parse.urljoin(
                            "http://localhost:{}".format(self.server.server_port),
                            "download-snap/test-snap.snap",
                        ),
                    },
                    "created-at": "2019-01-16T14:59:16.711111+00:00",
                    "confinement": confinement,
                    "revision": revision,
                }
            )
    if snap == "snap-1":
        snap_id = "snap-id-1"
    else:
        snap_id = f"{snap}-snap-id"
    return json.dumps(
        {
            "channel-map": channel_map,
            "snap": {
                "name": snap,
                "snap-id": snap_id,
                "publisher": {
                    "id": snap + "-developer-id",
                    "validation": "unproven",
                },
            },
            "snap-id": snap_id,
            "name": snap,
        }
    ).encode()