Best Python code snippet using localstack_python
aws_logs_info.py
Source: aws_logs_info.py
...155 return paginator.paginate(156 logGroupName=module.params['name']157 ), True158 else:159 return client.describe_metric_filters(160 logGroupName=module.params['name']161 ), False162 elif module.params['describe_queries']:163 if client.can_paginate('describe_queries'):164 paginator = client.get_paginator('describe_queries')165 return paginator.paginate(166 logGroupName=module.params['name'],167 status=module.params['query_status']168 ), True169 else:170 return client.describe_queries(171 logGroupName=module.params['name'],172 status=module.params['query_status']173 ), False...
test_cloudwatchlogs.py
Source: test_cloudwatchlogs.py
...34 'sa-east-1',35 ])36 barrel = CloudWatchLogsBarrel({}, clients={})37 self.assertEqual(supported_regions, barrel.supported_regions)38 def test_tap_functions_with_describe_metric_filters(self):39 fixture = [40 {41 'metricFilters': [42 {43 'filterName': 'a_trail',44 }45 ]46 }47 ]48 clients = {49 'us-east-1': self.client_mock(fixture)50 }51 barrel = CloudWatchLogsBarrel({}, clients=clients)52 tap_return = barrel.tap('describe_metric_filters')53 describe_metric_filters_return = barrel.describe_metric_filters()54 self.assertEqual(describe_metric_filters_return, tap_return)55 def test_tap_throws_error_with_unsupported_call(self):56 barrel = CloudWatchLogsBarrel({})57 with self.assertRaises(RuntimeError):58 barrel.tap('unsupported_call')59 def test_describe_metric_filters_returns_filters_by_region(self):60 fixture_1 = [61 {62 'metricFilters': [63 {64 'filterName': 'a_filter',65 }66 ]67 },68 {69 'metricFilters': [70 {71 'filterName': 'another_filter',72 }73 ]74 }75 ]76 fixture_2 = [77 {78 'metricFilters': [79 {80 'filterName': 'another_other_filter',81 }82 ]83 },84 {85 'metricFilters': [86 {87 'filterName': 'another_other_other_filter',88 }89 ]90 }91 ]92 clients = {93 'us-east-1': self.client_mock(fixture_1),94 'us-east-2': self.client_mock(fixture_2),95 }96 barrel = CloudWatchLogsBarrel({}, clients=clients)97 results = barrel.describe_metric_filters()98 expected = {99 'us-east-1': [100 {101 'filterName': 'a_filter'102 },103 {104 'filterName': 'another_filter'105 },106 ],107 'us-east-2': [108 {109 'filterName': 'another_other_filter'110 },111 {112 'filterName': 'another_other_other_filter'113 },114 ]115 }116 self.assertEqual(results, expected)117 def test_describe_metric_filters_empty(self):118 fixture = [119 {120 'metricFilters': []121 }122 ]123 clients = {124 'us-east-1': self.client_mock(fixture)125 }126 barrel = CloudWatchLogsBarrel({}, clients=clients)127 results = barrel.describe_metric_filters()128 expected = {129 'us-east-1': []130 }...
cloudwatchlogs.py
Source: cloudwatchlogs.py
...37 'logs',38 region_name=region,39 )40 return clients41 def describe_metric_filters(self):42 filters_by_region = {}43 for region, client in self.clients.items():44 paginator = self.clients[region].get_paginator(45 'describe_metric_filters',46 )47 response_iterator = paginator.paginate()48 filters = []49 for page in response_iterator:50 filters.extend(page['metricFilters'])51 filters_by_region[region] = filters...
Check out the latest blogs from LambdaTest on this topic:
The fact is not alien to us anymore that cross browser testing is imperative to enhance your application’s user experience. Enhanced knowledge of popular and highly acclaimed testing frameworks goes a long way in developing a new app. It holds more significance if you are a full-stack developer or expert programmer.
QA testers have a unique role and responsibility to serve the customer. Serving the customer in software testing means protecting customers from application defects, failures, and perceived failures from missing or misunderstood requirements. Testing for known requirements based on documentation or discussion is the core of the testing profession. One unique way QA testers can both differentiate themselves and be innovative occurs when senseshaping is used to improve the application user experience.
Having a good web design can empower business and make your brand stand out. According to a survey by Top Design Firms, 50% of users believe that website design is crucial to an organization’s overall brand. Therefore, businesses should prioritize website design to meet customer expectations and build their brand identity. Your website is the face of your business, so it’s important that it’s updated regularly as per the current web design trends.
Enterprise resource planning (ERP) is a form of business process management software—typically a suite of integrated applications—that assists a company in managing its operations, interpreting data, and automating various back-office processes. The introduction of a new ERP system is analogous to the introduction of a new product into the market. If the product is not handled appropriately, it will fail, resulting in significant losses for the business. Most significantly, the employees’ time, effort, and morale would suffer as a result of the procedure.
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!!