Best Python code snippet using localstack_python
provider.py
Source:provider.py
...25 )26class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):27 def __init__(self):28 self.forward_request = get_request_forwarder_http(self.get_forward_url)29 def get_forward_url(self) -> str:30 """Return the URL of the backend StepFunctions server to forward requests to"""31 return f"http://{LOCALHOST}:{config.LOCAL_PORT_STEPFUNCTIONS}"32 def on_before_start(self):33 start_stepfunctions()34 wait_for_stepfunctions()35 def create_state_machine(36 self, context: RequestContext, request: CreateStateMachineInput37 ) -> CreateStateMachineOutput:38 result = self.forward_request(context, request)39 event_publisher.fire_event(40 event_publisher.EVENT_STEPFUNCTIONS_CREATE_SM,41 payload={"m": event_publisher.get_hash(request["name"])},42 )43 return result...
AdUtil.py
Source:AdUtil.py
...40 # time.sleep(10)41 browser.save_screenshot(file_path)42 browser.close()43 return file_path44def get_forward_url(url):45 """è·åéå®åè·¯å¾"""46 req = urllib2.Request(url=url)47 response = urllib2.urlopen(req)48 return response.url49def md5(target):50 """51 çæmd5æè¦52 :param target: 53 :return: 54 """55 m = hashlib.md5()56 m.update(target)57 digest = m.hexdigest()58 return digest59def is_file_exist(file_path):60 return os.path.exists(file_path)61if __name__ == '__main__':62 print take_screenshot('http://www.qq.com/')...
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!!