Best Python code snippet using localstack_python
route53.py
Source: route53.py
...7 description = "Route53 Hosted Zones per Account"8 scope = QuotaScope.ACCOUNT9 @property10 def maximum(self):11 return self.boto_session.client('route53').get_account_limit(Type='MAX_HOSTED_ZONES_BY_OWNER')['Limit']['Value']12 @property13 def current(self):14 return self.boto_session.client('route53').get_account_limit(Type='MAX_HOSTED_ZONES_BY_OWNER')['Count']15class HealthCheckCountCheck(QuotaCheck):16 key = "route53_health_check_count"17 description = "Route53 Health Checks per Account"18 scope = QuotaScope.ACCOUNT19 @property20 def maximum(self):21 return self.boto_session.client('route53').get_account_limit(Type='MAX_HEALTH_CHECKS_BY_OWNER')['Limit']['Value']22 @property23 def current(self):24 return self.boto_session.client('route53').get_account_limit(Type='MAX_HEALTH_CHECKS_BY_OWNER')['Count']25class ReusableDelegationSetCountCheck(QuotaCheck):26 key = "route53_reusable_delegation_set_count"27 description = "Route53 Reusable Delegation Sets per Account"28 scope = QuotaScope.ACCOUNT29 @property30 def maximum(self):31 return self.boto_session.client('route53').get_account_limit(Type='MAX_REUSABLE_DELEGATION_SETS_BY_OWNER')['Limit']['Value']32 @property33 def current(self):34 return self.boto_session.client('route53').get_account_limit(Type='MAX_REUSABLE_DELEGATION_SETS_BY_OWNER')['Count']35class TrafficPolicyCountCheck(QuotaCheck):36 key = "route53_traffic_policy_count"37 description = "Route53 Traffic Policies per Account"38 scope = QuotaScope.ACCOUNT39 @property40 def maximum(self):41 return self.boto_session.client('route53').get_account_limit(Type='MAX_TRAFFIC_POLICIES_BY_OWNER')['Limit']['Value']42 @property43 def current(self):44 return self.boto_session.client('route53').get_account_limit(Type='MAX_TRAFFIC_POLICIES_BY_OWNER')['Count']45class TrafficPolicyInstanceCountCheck(QuotaCheck):46 key = "route53_traffic_policy_instance_count"47 description = "Route53 Traffic Policy Instances per Account"48 scope = QuotaScope.ACCOUNT49 @property50 def maximum(self):51 return self.boto_session.client('route53').get_account_limit(Type='MAX_TRAFFIC_POLICY_INSTANCES_BY_OWNER')['Limit']['Value']52 @property53 def current(self):54 return self.boto_session.client('route53').get_account_limit(Type='MAX_TRAFFIC_POLICY_INSTANCES_BY_OWNER')['Count']55class RecordsPerHostedZoneCheck(InstanceQuotaCheck):56 key = "route53_records_per_hosted_zone"57 description = "Records per Route53 Hosted Zone"58 instance_id = 'Hosted Zone ID'59 @staticmethod60 def get_all_identifiers(session: boto3.Session) -> typing.List[str]:61 return [zone['Id'] for zone in session.client('route53').list_hosted_zones()['HostedZones']]62 @property63 def maximum(self):64 try:65 return self.boto_session.client('route53').get_hosted_zone_limit(Type='MAX_RRSETS_BY_ZONE', HostedZoneId=self.instance_id)['Limit']['Value']66 except self.boto_session.client('route53').exceptions.NoSuchHostedZone as e:67 raise InstanceWithIdentifierNotFound(self) from e68 @property...
test_account_limits.py
Source: test_account_limits.py
...29 cls.rse2_id = get_rse(cls.rse2).id30 def test_set_account_limit(self):31 """ ACCOUNT_LIMIT (CORE): Setting account limit """32 account_limit.set_account_limit(account=self.account, rse_id=self.rse1_id, bytes=100000)33 assert_equal(account_limit.get_account_limit(account=self.account, rse_id=self.rse1_id), 100000)34 assert_equal(account_limit.get_account_limit(account=self.account, rse_id=self.rse2_id), float("Inf"))35class TestAccountClient():36 @classmethod37 def setUpClass(cls):38 # Add test account39 cls.account = ''.join(random.choice(string.ascii_uppercase) for x in range(10))40 add_account(account=cls.account, type=AccountType.USER)41 # Add test RSE42 cls.rse1 = 'MOCK'43 cls.rse2 = 'MOCK2'44 cls.rse1_id = get_rse(cls.rse1).id45 cls.rse2_id = get_rse(cls.rse2).id46 def setup(self):47 self.client = AccountClient()48 self.alclient = AccountLimitClient()49 def test_listing_account_limits(self):50 """ ACCOUNT (CLIENTS): Test listing account limits """51 account_limit.set_account_limit(account=self.account, rse_id=self.rse1_id, bytes=12345)52 account_limit.set_account_limit(account=self.account, rse_id=self.rse2_id, bytes=12345)53 limits = self.client.get_account_limits(account=self.account)54 assert_in((self.rse1, 12345), limits.items())55 assert_in((self.rse2, 12345), limits.items())56 account_limit.delete_account_limit(account=self.account, rse_id=self.rse1_id)57 account_limit.delete_account_limit(account=self.account, rse_id=self.rse2_id)58 def test_listing_account_limit(self):59 """ ACCOUNT (CLIENTS): Test listing account limit """60 account_limit.delete_account_limit(account=self.account, rse_id=self.rse1_id)61 account_limit.set_account_limit(account=self.account, rse_id=self.rse1_id, bytes=333)62 limit = self.client.get_account_limit(account=self.account, rse=self.rse1)63 assert_equal(limit, {self.rse1: 333})64 account_limit.delete_account_limit(account=self.account, rse_id=self.rse1_id)65 def test_setting_account_limit(self):66 """ ACCOUNTLIMIT (CLIENTS): Test setting account limit """67 self.alclient.set_account_limit(account=self.account, rse=self.rse1, bytes=987)68 limit = self.client.get_account_limit(account=self.account, rse=self.rse1)69 assert_equal(limit[self.rse1], 987)70 account_limit.delete_account_limit(account=self.account, rse_id=self.rse1_id)71 def test_deleting_account_limit(self):72 """ ACCOUNTLIMIT (CLIENTS): Test deleting account limit """73 self.alclient.set_account_limit(account=self.account, rse=self.rse1, bytes=786)74 limit = self.client.get_account_limit(account=self.account, rse=self.rse1)75 assert_equal(limit, {self.rse1: 786})76 self.alclient.delete_account_limit(account=self.account, rse=self.rse1)77 limit = self.client.get_account_limit(account=self.account, rse=self.rse1)78 assert_equal(limit[self.rse1], float('Inf'))...
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!!