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.
)
    def test_get_event_source_mapping(self):
        region = lambda_api.LambdaRegion.get()
        with self.app.test_request_context():
            region.event_source_mappings.append({"UUID": self.TEST_UUID})
            result = lambda_api.get_event_source_mapping(self.TEST_UUID)
            self.assertEqual(self.TEST_UUID, json.loads(result.get_data()).get("UUID"))
    def test_get_event_sources(self):
        region = lambda_api.LambdaRegion.get()
        with self.app.test_request_context():
            region.event_source_mappings.append(
                {"UUID": self.TEST_UUID, "EventSourceArn": "the_arn"}
            )
            
            result = lambda_api.get_event_sources(source_arn="the_arn")
            self.assertEqual(1, len(result))
            self.assertEqual(self.TEST_UUID, result[0].get("UUID"))
            
            result = lambda_api.get_event_sources(source_arn="the_")
            self.assertEqual(0, len(result))
    def test_get_event_sources_with_paths(self):
        region = lambda_api.LambdaRegion.get()
        with self.app.test_request_context():
            region.event_source_mappings.append(
                {"UUID": self.TEST_UUID, "EventSourceArn": "the_arn/path/subpath"}
            )
            
            result = lambda_api.get_event_sources(source_arn="the_arn")
            self.assertEqual(1, len(result))
            result = lambda_api.get_event_sources(source_arn="the_arn/path")