Best Python code snippet using locust
urls.py
Source:urls.py
1from django.conf.urls import url2from deploy.views.DeployTaskView import DeployTaskView,DeployTaskSearchView,DeployTaskDelete,DeployTaskExamine3from deploy.views.UploadFileView import UploadFileView4from deploy.views.ScriptExecuteView import FileListView,FileExecuteView,FileDelete,ExecuteResView5from deploy.views.DeployTaskView import test_pass,backspace,sql_file_download,test_report_download,receiving_report_download6from deploy.views.DeployTaskView import TestReportUploadView7from deploy.views.DeployTaskView import DeployDetailView8from deploy.views.DeployTaskView import upgrade_success_deploytask9from deploy.views.DeployTaskView import upgrade_failure_deploytask,upgrade_partition_deploytask,upgrade_continue_deploytask10from deploy.views.ScriptView import ScriptManageView,ScriptAddView,ScriptUpdateView,ScriptExecuteView,ScriptDeleteView,ScriptTransferView11from deploy.views.DBFileView import SchemaView,VerifyPersonView12from deploy.views.DeployTaskView import upgrade_deploytask13from deploy.views.SqlExecuteView import SqlFileUpload,SqlFile,SqlFileDelete,SqlFileDetail,sqlfile_download14from django.views.decorators.csrf import csrf_exempt15urlpatterns = [16 url(r"^task/$",csrf_exempt(DeployTaskView.as_view()),name="deploy_task"),17 url(r"^task/list/$",csrf_exempt(DeployTaskSearchView.as_view()),name="deploy_task_list"),18 url(r"^task/detail/(?P<module_name>(.*))/$",csrf_exempt(DeployDetailView.as_view()),name="deploy_task_detail"),19 url(r"^task/delete/(?P<id>[0-9]+)/$",csrf_exempt(DeployTaskDelete.as_view()),name="deploy_task_delete"),20 url(r"^task/examine/(?P<id>[0-9]+)/$",csrf_exempt(DeployTaskExamine.as_view()),name="deploy_task_examine"),21 url(r"^task/test/pass/(?P<module_name>(.*))/(?P<tag_version>(.*))/$",test_pass,name="test_pass"),22 url(r"^task/back/(?P<principal>(.*))/(?P<project>(.*))/(?P<tag_version>(.*))/$",backspace,name="backspace"),23 url(r"^task/download/sql/file/(?P<module_name>(.*))/(?P<tag_version>(.*))/$",sql_file_download,name="download_sql"),24 url(r"^task/test/report/upload/(?P<module_name>(.*))/(?P<tag_version>(.*))/$",csrf_exempt(TestReportUploadView.as_view()),name="test_report_upload"),25 url(r"^task/test/report/download/(?P<module_name>(.*))/(?P<tag_version>(.*))/(?P<test_report_filename>(.*))/$",test_report_download,name="test_report_download"),26 url(r"^task/receiving/report/download/(?P<module_name>(.*))/(?P<tag_version>(.*))/(?P<receiving_report_filename>(.*))/$",receiving_report_download,name="receiving_report_download"),27 url(r"^task/rdsschema/select/$",csrf_exempt(SchemaView.as_view()),name="schema"),28 url(r"^task/verifyperson/select/$",csrf_exempt(VerifyPersonView.as_view()),name="verify_person"),29 url(r"^task/upgrade/(?P<id>[0-9]+)/$",upgrade_deploytask,name="upgrade_deploytask"),30 url(r"^task/upgrade/success/(?P<id>[0-9]+)/$",upgrade_success_deploytask,name="upgrade_success"),31 url(r"^task/upgrade/failure/(?P<id>[0-9]+)/$",upgrade_failure_deploytask,name="upgrade_failure"),32 url(r"^task/upgrade/partition/(?P<module_name>(.*))/(?P<tag_version>(.*))/$",upgrade_partition_deploytask,name="upgrade_partition"),33 url(r"^task/upgrade/continue/(?P<module_name>(.*))/(?P<tag_version>(.*))/$",upgrade_continue_deploytask,name="upgrade_continue"),34 url(r"^scripts/$",csrf_exempt(ScriptManageView.as_view()),name="script_manage"),35 url(r"^scripts/add/$",csrf_exempt(ScriptAddView.as_view()),name="script_add"),36 url(r"^scripts/delete/(?P<id>[0-9]+)/$",csrf_exempt(ScriptDeleteView.as_view()),name="script_delete"),37 url(r"^scripts/update/(?P<id>[0-9]+)/$",csrf_exempt(ScriptUpdateView.as_view()),name="script_update"),38 url(r"^scripts/execute/(?P<id>[0-9]+)/$",csrf_exempt(ScriptExecuteView.as_view()),name="minion_select"),39 url(r"^scripts/execute/$",csrf_exempt(ScriptExecuteView.as_view()),name="script_execute"),40 url(r"^scripts/transfer/(?P<id>[0-9]+)/$",csrf_exempt(ScriptTransferView.as_view()),name="minions_select"),41 url(r"^upload/file/$",csrf_exempt(UploadFileView.as_view()),name="upload_file"),42 url(r"^upload/file/list/$",csrf_exempt(FileListView.as_view()),name="execute_file_list"),43 url(r"^upload/file/execute/(?P<id>[0-9]+)/$",csrf_exempt(FileExecuteView.as_view()),name="execute_file"),44 url(r"^upload/file/delete/(?P<id>[0-9]+)/$",csrf_exempt(FileDelete.as_view()),name="delete_file"),45 url(r"^execute/file/res/(?P<id>[0-9]+)/$",csrf_exempt(ExecuteResView.as_view()),name="execute_file"),46 url(r"^sql/upload/$",csrf_exempt(SqlFileUpload.as_view()),name="sql_upload"),47 url(r"^sql/upload/list/$",csrf_exempt(SqlFile.as_view()),name="sql_file_list"),48 url(r"^sql/upload/detail/(?P<upload_person>(.*))/$",csrf_exempt(SqlFileDetail.as_view()),name="sql_file_detail"),49 url(r"^sql/upload/delete/(?P<id>[0-9]+)/$",csrf_exempt(SqlFileDelete.as_view()),name="sql_file_delete"),50 url(r"^sql/upload/download/(?P<id>[0-9]+)/$",sqlfile_download,name="sql_file_download")...
test_batch_download.py
Source:test_batch_download.py
1# Use workbook fixture from BDD tests (including elasticsearch)2from .features.conftest import app_settings, app, workbook3def test_report_download(testapp, workbook):4 res = testapp.get('/report.tsv?type=Experiment&sort=accession')5 assert res.headers['content-type'] == 'text/tsv; charset=UTF-8'6 disposition = res.headers['content-disposition']7 assert disposition.startswith('attachment;filename="Experiment Report') and disposition.endswith('.tsv"')8 lines = res.body.splitlines()9 assert lines[1].split(b'\t') == [10 b'ID', b'Accession', b'Assay Type', b'Assay Nickname', b'Target label',11 b'Target gene', b'Biosample summary', b'Biosample', b'Description', b'Lab',12 b'Project', b'Status', b'Biological replicate', b'Technical replicate',13 b'Linked Antibody', b'Species', b'Life stage', b'Age', b'Age Units',14 b'Treatment', b'Term ID', b'Concentration', b'Concentration units',15 b'Duration', b'Duration units', b'Synchronization',16 b'Post-synchronization time', b'Post-synchronization time units',17 b'Replicates',...
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!!