Best Python code snippet using localstack_python
tag_resource.py
Source: tag_resource.py
...50 """51 logger.info("Let's add tags {} for resource with arn: {}...".format(tags, resource_arn))52 qldb_client.tag_resource(ResourceArn=resource_arn, Tags=tags)53 logger.info('Successfully added tags.')54def untag_resource(resource_arn, tag_keys):55 """56 Remove one or more tags from the specified QLDB resource.57 :type resource_arn: dict58 :param resource_arn: The Amazon Resource Name (ARN) of the ledger from which to remove the tags.59 :type tag_keys: list60 :param tag_keys: The list of tag keys to remove.61 """62 logger.info("Let's remove tags {} for resource with arn: {}.".format(tag_keys, resource_arn))63 qldb_client.untag_resource(ResourceArn=resource_arn, TagKeys=tag_keys)64 logger.info('Successfully removed tags.')65def list_tags(resource_arn):66 """67 Returns all tags for a specified Amazon QLDB resource.68 :type resource_arn: dict69 :param resource_arn: The Amazon Resource Name (ARN) for which to list tags off.70 :rtype: dict71 :return: All tags on the specified resource.72 """73 logger.info("Let's list the tags for resource with arn: {}.".format(resource_arn))74 result = qldb_client.list_tags_for_resource(ResourceArn=resource_arn)75 logger.info('Success. Tags: {}.'.format(result.get('Tags')))76 return result77def main(ledger_name=Constants.LEDGER_NAME_WITH_TAGS):78 """79 Tagging and un-tagging resources, including tag on create.80 """81 try:82 result = create_with_tags(ledger_name, CREATE_TAGS)83 wait_for_active(ledger_name)84 ARN = result.get('Arn')85 list_tags(ARN)86 untag_resource(ARN, REMOVE_TAGS)87 list_tags(ARN)88 tag_resource(ARN, ADD_TAGS)89 list_tags(ARN)90 except Exception as e:91 logger.exception('Unable to tag or untag resources!')92 raise e93if __name__ == '__main__':...
test_tagging.py
Source: test_tagging.py
...13 self.assertDictEqual(expected, actual)14 def test_delete_tag(self):15 tags = [{'Key': 'key_key', 'Value': 'value_value'}]16 self.svc.tag_resource('arn', tags)17 self.svc.untag_resource('arn', ['key_key'])18 result = self.svc.list_tags_for_resource('arn')19 self.assertEqual(20 result, {'Tags': []})21 def test_list_empty_delete(self):22 self.svc.untag_resource('arn', ['key_key'])23 result = self.svc.list_tags_for_resource('arn')24 self.assertEqual(...
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!!