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.
"URI": TEST_SECRETSMANANAGER_EVENT_SOURCE_ARN,
                        }
                    ],
                    "SelfManagedEventSource": {
                        "Endpoints": {"KAFKA_BOOTSTRAP_SERVERS": ["127.0.0.1:9092"]}
                    },
                    "Enabled": "true",
                }
            ),
        )
        createResult = json.loads(createResponse.get_data())
        putResponse = self.client.put(
            "{0}/event-source-mappings/{1}".format(API_PATH_ROOT, createResult.get("UUID")),
            data=json.dumps({"Enabled": "false"}),
        )
        putResult = json.loads(putResponse.get_data())
        self.assertEqual("Disabled", putResult["State"])
        getResponse = self.client.get(
            "{0}/event-source-mappings/{1}".format(API_PATH_ROOT, createResult.get("UUID"))
        )
        getResult = json.loads(getResponse.get_data())
        self.assertEqual("Disabled", getResult["State"])
    def test_publish_function_version(self):
        with self.app.test_request_context():
            self._create_function(self.FUNCTION_NAME)
            result = json.loads(lambda_api.publish_version(self.FUNCTION_NAME).get_data())
            result.pop(
                "RevisionId", None
            )  
            expected_result = {}