Best Python code snippet using localstack_python
test_s_q.py
Source:test_s_q.py
...118# actual = 119# expected = 120# assert actual ==121@pytest.fixture122def create_stack():123 s = Stack()124 return s125@pytest.fixture126def create_queue():127 q = Queue()...
deploy_daimler_demo.py
Source:deploy_daimler_demo.py
...26 def deploy_network(self):27 vpc_name = self.name + '_vpc'28 vpc_template = os.path.join(HOT_TEMPLATE_PATH, 'vpc.yaml')29 vpc_para = {'vpc_name': vpc_name, 'cidr' : "172.31.0.0/16", 'snat' : "true" }30 OTC.cloud.create_stack(vpc_name,31 template_file=vpc_template,32 paramaters=vpc_para,33 wait=True)3435 self.router = OTC.cloud.get_router(vpc_name)3637 subnet_template = os.path.join(HOT_TEMPLATE_PATH, 'subnet.yaml')38 subnet1_para = {'vpc_id': vpc_name, 'name': 'subnet1', 'cidr' : "172.31.16.0/24"}39 OTC.cloud.create_stack(vpc_name + '_subnet1',40 template_file=subnet_template,41 paramaters=subnet1_para)4243 subnet1_1_para = {'vpc_id': vpc_name, 'name': 'subnet1-1', 'cidr' : "172.31.48.0/24"}44 OTC.cloud.create_stack(vpc_name + '_subnet1-1',45 template_file=subnet_template,46 paramaters=subnet1_1_para)4748 subnet2_para = {'vpc_id': vpc_name, 'name': 'subnet2', 'cidr' : "172.31.80.0/24"}49 OTC.cloud.create_stack(vpc_name + '_subnet2',50 template_file=subnet_template,51 paramaters=subnet2_para)5253 subnet3_para = {'vpc_id': vpc_name, 'name': 'subnet3', 'cidr' : "172.31.112.0/24"}54 OTC.cloud.create_stack(vpc_name + '_subnet3',55 template_file=subnet_template,56 paramaters=subnet3_para)5758 def deploy_server(self):59 pass6061 def deploy_sg(self):62 sg_template = os.path.join(HOT_TEMPLATE_PATH, 'daimler-demo', 'sg.yaml')63 sg1_name = 'Daimler_AZ1_SG1'64 sg1_para = {'name': sg1_name}65 OTC.cloud.create_stack(sg1_name,66 template_file=sg_template,67 paramaters=sg1_para)6869 sg_template = os.path.join(HOT_TEMPLATE_PATH, 'daimler-demo', 'sg.yaml')70 sg2_name = 'Daimler_AZ1_SG2'71 sg2_para = {'name': sg2_name}72 OTC.cloud.create_stack(sg2_name,73 template_file=sg_template,74 paramaters=sg2_para)7576 def deploy_fw(self):77 pass7879 def deploy_vpc_peering(self):80 pass8182 def deploy_elb(self):83 pass8485def deploy():86 dd = DaimlerDemo()
...
2-stack.py
Source:2-stack.py
1class stack:2 def __init__(self):3 self.stack = []4 def push(self, element):5 return self.stack.append(element)6 def __pos__(self):7 return self.stack.pop()8 def isEmpty(self):9 return len(self.stack) == 010 def peek(self):11 if len(self.stack) != 0:12 return self.stack[-1]13 else:14 return "Stack is Empty"15create_stack = stack()16create_stack.push(5)17create_stack.push(2)18create_stack.push(3)19create_stack.push(4)20print(create_stack.stack)21# # `[5, 2, 3, 4]`22#23# # create_stack.pop()24# # `4`25#26# create_stack.peek()27# # `3`28#29# create_stack.pop()30# create_stack.pop()31# create_stack.pop()32# create_stack.isEmpty()33# # `True`34#35# create_stack.peek()...
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!!