def METHOD_NAME(self, mocker, set_env, is_operation_supported):
    set_env("AWS_DEFAULT_REGION", "us-east-1")
    mocked_assert_supported_operation = mocker.patch(
        "pcluster.cli.commands.image_logs.assert_supported_operation",
        side_effect=None if is_operation_supported else BadRequestException("ERROR MESSAGE"),
    )
    mocked_export_logs = mocker.patch("pcluster.cli.commands.image_logs.ImageBuilder.export_logs")
    command = ["export-image-logs"] + self._build_cli_args(
        {**REQUIRED_ARGS},
    )
    try:
        run(command)
        if not is_operation_supported:
            fail("Expected to fail due to operation being unsupported.")
    except Exception as exc:
        assert_that(exc).is_instance_of(APIOperationException)
        assert_that(exc.data).is_equal_to(dict(message="Bad Request: ERROR MESSAGE"))
    mocked_assert_supported_operation.assert_called_once()
    mocked_assert_supported_operation.assert_called_with(operation=Operation.EXPORT_IMAGE_LOGS, region="us-east-1")
    if is_operation_supported:
        mocked_export_logs.assert_called_once()
    else:
        mocked_export_logs.assert_not_called()