def METHOD_NAME(tmp_path, capsys):
    """Test that we set the correct MIME type for each file extension"""
    for ext in [
        "whl",
        "tar",
        "zip",
        "js",
        "ts",
        "json",
        "ttf",
        "a",
        "mjs.map",
        "mjs",
        "tar.gz",
        "tar.bz2",
    ]:
        (tmp_path / f"a.{ext}").write_text("a")
    bucket_name = "mybucket"
    s3_client = boto3.client("s3", region_name="us-east-1")
    s3_client.create_bucket(Bucket=bucket_name)
    deploy_to_s3_main(
        tmp_path,
        remote_prefix=PurePosixPath(""),
        bucket=bucket_name,
        cache_control="max-age=30758400",
        pretend=False,
        overwrite=False,
        rm_remote_prefix=False,
        access_key_env="AWS_ACCESS_KEY_ID",
        secret_key_env="AWS_SECRET_ACCESS_KEY",
    )
    def get_header(key, field="content-type"):
        res = s3_client.get_object(Bucket=bucket_name, Key=key)
        return res["ResponseMetadata"]["HTTPHeaders"].get(field)
    assert get_header("a.js", "content-encoding") == "gzip"
    assert get_header("a.tar.gz", "content-encoding") is None
    assert get_header("a.tar.bz2", "content-encoding") is None
    # These  MIME types we set explicitly for better CDN compression
    assert get_header("a.whl") == "application/wasm"
    assert get_header("a.tar") == "application/wasm"
    assert get_header("a.zip") == "application/wasm"
    assert get_header("a.a") == "application/wasm"
    # The rest we set based on the file extension
    assert get_header("a.js") == "text/javascript"
    assert get_header("a.mjs") == "text/javascript"
    assert get_header("a.ts") == "text/x.typescript"
    assert get_header("a.json") == "application/json"
    assert get_header("a.ttf") == "font/ttf"
    assert get_header("a.mjs.map") == "binary/octet-stream"
    # Test that we can read the data back
    res = s3_client.get_object(Bucket=bucket_name, Key="a.js")
    stream = io.BytesIO()
    with gzip.GzipFile(fileobj=res["Body"], mode="r") as fh:
        shutil.copyfileobj(fh, stream)
    assert stream.getvalue() == b"a"
    res = s3_client.get_object(Bucket=bucket_name, Key="a.tar.bz2")
    data = res["Body"].read()  # Should not raise an exception
    assert data == b"a"