While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
result = []
    for region, details in LambdaRegion.regions().items():
        for m in details.event_source_mappings:
            if not func_name or (m["FunctionArn"] in [func_name, func_arn(func_name)]):
                if event_source_arn_matches(mapped=m.get("EventSourceArn"), searched=source_arn):
                    result.append(m)
    return result
def get_function_version(arn, version):
    region = LambdaRegion.get()
    func = region.lambdas.get(arn)
    return format_func_details(func, version=version, always_add_version=True)
def publish_new_function_version(arn):
    region = LambdaRegion.get()
    lambda_function = region.lambdas.get(arn)
    versions = lambda_function.versions
    max_version_number = lambda_function.max_version()
    next_version_number = max_version_number + 1
    latest_hash = versions.get(VERSION_LATEST).get("CodeSha256")