Best Python code snippet using localstack_python
provider.py
Source:provider.py
...118 "Could not deliver test message to specified Firehose stream. "119 "Check if the given Firehose stream is in ACTIVE state."120 )121 else:122 service = aws_stack.extract_service_from_arn(destination_arn)123 raise InvalidParameterException(124 f"PutSubscriptionFilter operation cannot work with destinationArn for vendor {service}"125 )126 if filter_pattern:127 for stream in log_group.streams.values():128 stream.filter_pattern = filter_pattern129 log_group.put_subscription_filter(filter_name, filter_pattern, destination_arn, role_arn)130@patch(MotoLogStream.put_log_events, pass_target=False)131def moto_put_log_events(self, log_group_name, log_stream_name, log_events):132 # TODO: call/patch upstream method here, instead of duplicating the code!133 self.last_ingestion_time = int(unix_time_millis())134 self.stored_bytes += sum([len(log_event["message"]) for log_event in log_events])135 events = [logs_models.LogEvent(self.last_ingestion_time, log_event) for log_event in log_events]136 self.events += events...
logs_starter.py
Source:logs_starter.py
...63 "Could not deliver test message to specified Firehose stream. "64 "Check if the given Firehose stream is in ACTIVE state."65 )66 else:67 service = aws_stack.extract_service_from_arn(destination_arn)68 raise InvalidParameterException(69 "PutSubscriptionFilter operation cannot work with destinationArn for vendor %s"70 % service71 )72 log_group.put_subscription_filter(73 filter_name, filter_pattern, destination_arn, role_arn74 )75 return put_subscription_filter76 def put_log_events_model(self, log_group_name, log_stream_name, log_events, sequence_token):77 # TODO: call/patch upstream method here, instead of duplicating the code!78 self.last_ingestion_time = int(unix_time_millis())79 self.stored_bytes += sum([len(log_event["message"]) for log_event in log_events])80 events = [81 logs_models.LogEvent(self.last_ingestion_time, log_event) for log_event in log_events...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!