How to use _setup_job method in avocado

Best Python code snippet using avocado_python

upload.py

Source:upload.py Github

copy

Full Screen

...17 assert dataset_upload_inputs, Exception("No dataset upload groups were found.")18 persisting_uploads_timer = ExecutionTimer()19 incoming = upload_common.persist_uploads(incoming, trans)20 log.debug("Persisted uploads %s" % persisting_uploads_timer)21 rval = self._setup_job(tool, trans, incoming, dataset_upload_inputs, history)22 return rval23 def _setup_job(self, tool, trans, incoming, dataset_upload_inputs, history):24 """Take persisted uploads and create a job for given tool."""25 def _create_job(self, *args, **kwds):26 """Wrapper around upload_common.create_job with a timer."""27 create_job_timer = ExecutionTimer()28 rval = upload_common.create_job(*args, **kwds)29 log.debug("Created upload job %s" % create_job_timer)30 return rval31class UploadToolAction(BaseUploadToolAction):32 def _setup_job(self, tool, trans, incoming, dataset_upload_inputs, history):33 check_timer = ExecutionTimer()34 uploaded_datasets = upload_common.get_uploaded_datasets(trans, '', incoming, dataset_upload_inputs, history=history)35 if not uploaded_datasets:36 return None, 'No data was entered in the upload form, please go back and choose data to upload.'37 json_file_path = upload_common.create_paramfile(trans, uploaded_datasets)38 data_list = [ud.data for ud in uploaded_datasets]39 log.debug("Checked uploads %s" % check_timer)40 return self._create_job(41 trans, incoming, tool, json_file_path, data_list, history=history42 )43class FetchUploadToolAction(BaseUploadToolAction):44 def _setup_job(self, tool, trans, incoming, dataset_upload_inputs, history):45 # Now replace references in requests with these.46 files = incoming.get("files", [])47 files_iter = iter(files)48 request = json.loads(incoming.get("request_json"))49 def replace_file_srcs(request_part):50 if isinstance(request_part, dict):51 if request_part.get("src", None) == "files":52 path_def = next(files_iter)53 if path_def is None or path_def["file_data"] is None:54 raise RequestParameterMissingException("Failed to find uploaded file matching target with src='files'")55 request_part["path"] = path_def["file_data"]["local_filename"]56 if "name" not in request_part:57 request_part["name"] = path_def["file_data"]["filename"]58 request_part["src"] = "path"...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run avocado automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful