Best Python code snippet using autotest_python
views.py
Source:views.py
...59 pip_id_queue.append(id)60 plugin_inst_queue.append(plugin_inst)61 # run plugin instances62 for plg_inst in plugin_instances:63 run_if_ready(plg_inst, plg_inst.previous)64 def list(self, request, *args, **kwargs):65 """66 Overriden to return the list of workflows for the queried pipeline.67 A document-level link relation and a collection+json template are also added to68 the response.69 """70 queryset = self.get_workflows_queryset()71 response = services.get_list_response(self, queryset)72 pipeline = self.get_object()73 # append document-level link relations74 links = {'pipeline': reverse('pipeline-detail', request=request,75 kwargs={"pk": pipeline.id})}76 response = services.append_collection_links(response, links)77 # append write template...
utils.py
Source:utils.py
1from plugininstances.tasks import run_plugin_instance2def run_if_ready(plg_inst, previous):3 """4 Set the status of ``plg_inst`` accordingly depending on the state of its previous5 plugin instance.6 """7 if previous is None or previous.status == 'finishedSuccessfully':8 # schedule the plugin's app to run9 plg_inst.status = 'scheduled' # status changes to 'scheduled' right away10 plg_inst.save()11 run_plugin_instance.delay(plg_inst.id) # call async task12 elif previous.status in ('created', 'waiting', 'scheduled',13 'registeringFiles', 'started'):14 plg_inst.status = 'waiting'15 plg_inst.save()16 elif previous.status in ('finishedWithError', 'cancelled'):...
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!!