Best Python code snippet using grail_python
step_1.py
Source:step_1.py
...4SHORT_SHA = get_short_sha()5IMAGEPROJECT = get_imageproject()6# clear data7clear_data()8verify_result(change_permission())9# install environment10verify_result(install_environment())11# clone-dcm4che12verify_result(clone_dcm4che())13# checkout-dcm4che-tag14verify_result(checkout_dcm4che_tag())15# build-tools16verify_result(build_tools())17# store-scp18verify_result(store_scp(substitution.STORE_SCP_RUN_STEP, substitution.STORE_SCP_PORT))19# build adapter20verify_result(build_adapter())21# setup-dataset-and-dicom-store22verify_result(setup_dataset_and_dicom_store(substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME))23# build adapter image24verify_result(build_adapter_image(IMAGEPROJECT, SHORT_SHA))25# run adapter26verify_result(run_import_adapter(substitution.ADAPTER_PORT, substitution.VERSION, substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME, substitution.STORE_SCP_RUN_STEP, substitution.STORE_SCP_PORT, substitution.COMMITMENT_SCU_STEP, substitution.COMMITMENT_SCU_PORT))27# wait-for-adapter28verify_result(wait_for_port(substitution.ADAPTER_RUN_STEP, substitution.ADAPTER_PORT))29# wait-for-storescp30verify_result(wait_for_port(substitution.STORE_SCP_RUN_STEP, substitution.STORE_SCP_PORT))31# run-store-scu32verify_result(run_store_scu(substitution.ADAPTER_RUN_STEP, substitution.ADAPTER_PORT, "../../../integration_test/data/example.dcm"))33# run-store-scu-destination234verify_result(run_store_scu(substitution.STORE_SCP_RUN_STEP, substitution.ADAPTER_PORT, "../../../integration_test/data/example-mg.dcm"))35# run-find-scu-instance36verify_result(run_find_scu_instance(substitution.STORE_SCP_RUN_STEP, substitution.ADAPTER_PORT))37# run-find-scu-series38verify_result(run_find_scu_series(substitution.STORE_SCP_RUN_STEP, substitution.ADAPTER_PORT))39# run-find-scu-study40verify_result(run_find_scu_study(substitution.STORE_SCP_RUN_STEP, substitution.ADAPTER_PORT))41# run-move-scu42verify_result(run_move_scu(substitution.STORE_SCP_RUN_STEP, substitution.ADAPTER_PORT))43# run-commitment-scu44verify_result(run_commitment_scu(substitution.STORE_SCP_RUN_STEP, substitution.ADAPTER_PORT, substitution.COMMITMENT_SCU_PORT, "/workspace/integration_test/data/example-redacted-jp2k.dcm"))45# close-adapter46runCommand("sudo kill -9 $(lsof -t -i:"+substitution.STORE_SCP_PORT+")", "Kill process on port "+ substitution.STORE_SCP_PORT)47runCommand("sudo kill -9 $(lsof -t -i:"+substitution.ADAPTER_PORT+")", "Kill process on port "+ substitution.ADAPTER_PORT)48# check-store-curl49verify_result(check_store_curl(substitution.VERSION, substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME, substitution.REPLACED_UID, "integration_test/downloaded.dcm"))50# check-store-diff51verify_result(check_diff("integration_test/downloaded.dcm", "integration_test/data/example-redacted-jp2k.dcm"))52# # check-store-curl-destination-253verify_result(check_store_curl(substitution.VERSION, substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME+"-destination-2", substitution.REPLACED_UID, "integration_test/downloaded-destination-2.dcm"))54# check-store-diff-destination-255verify_result(check_diff("integration_test/downloaded-destination-2.dcm", "integration_test/data/example-redacted-mg-jp2k.dcm"))56# check-find-diff-instance57verify_result(check_diff("integration_test/findscu-instance-result1.xml", "integration_test/data/findscu-instance-expected.xml"))58# check-find-diff-series59verify_result(check_diff("integration_test/findscu-series-result1.xml", "integration_test/data/findscu-series-expected.xml"))60# check-find-diff-study61verify_result(check_diff("integration_test/findscu-study-result1.xml", "integration_test/data/findscu-study-expected.xml"))62# check-move-diff63verify_result(check_diff("integration_test/storescp-data/"+substitution.REPLACED_UID, "integration_test/data/example-redacted-moved-jp2k.dcm"))64# check-commitment-diff65verify_result(check_commitment_diff())66# delete-dicom-store67verify_result(delete_dicom_store(STORE_NAME, substitution.PROJECT, substitution.DATASET, substitution.LOCATION))68# delete-dicom-store destination-2...
step_3.py
Source:step_3.py
1import substitution2from general import *3STORE_NAME = get_random_string(20)4# install environment5verify_result(install_environment())6# store-scp7verify_result(store_scp(substitution.STORE_SCP_RUN_STEP, substitution.STORE_SCP_PORT))8# build adapter9verify_result(build_adapter())10# setup-dataset-and-dicom-store11verify_result(setup_dataset_and_dicom_store(substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME))12# run adapter13verify_result(run_import_adapter_local_backup(substitution.ADAPTER_PORT, substitution.VERSION, substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME))14# wait-for-adapter15verify_result(wait_for_port(substitution.ADAPTER_RUN_STEP, substitution.ADAPTER_PORT))16# wait-for-storescp17verify_result(wait_for_port(substitution.STORE_SCP_RUN_STEP, substitution.STORE_SCP_PORT))18# run-store-scu19verify_result(run_store_scu(substitution.ADAPTER_RUN_STEP, substitution.ADAPTER_PORT, "../../../integration_test/data/example2.dcm"))20# close-adapter21runCommand("sudo kill -9 $(lsof -t -i:"+substitution.STORE_SCP_PORT+")", "Kill process on port "+ substitution.STORE_SCP_PORT)22runCommand("sudo kill -9 $(lsof -t -i:"+substitution.ADAPTER_PORT+")", "Kill process on port "+ substitution.ADAPTER_PORT)23# check-store-curl24verify_result(check_store_curl(substitution.VERSION, substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME, substitution.REPLACED_UID_2, "integration_test/downloaded2.dcm"))25# check-store-diff26verify_result(check_diff("integration_test/downloaded2.dcm", "integration_test/data/example2.dcm"))27# delete-dicom-store28verify_result(delete_dicom_store(STORE_NAME, substitution.PROJECT, substitution.DATASET, substitution.LOCATION))29# delete-dicom-store destination-2...
step_2.py
Source:step_2.py
1import substitution2from general import *3STORE_NAME = get_random_string(20)4# install environment5verify_result(install_environment())6# store-scp7verify_result(store_scp(substitution.STORE_SCP_RUN_STEP, substitution.STORE_SCP_PORT))8# build adapter9verify_result(build_adapter())10# setup-dataset-and-dicom-store11verify_result(setup_dataset_and_dicom_store(substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME))12# run adapter13verify_result(run_import_adapter_http2(substitution.ADAPTER_PORT, substitution.VERSION, substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME))14# wait-for-adapter15verify_result(wait_for_port(substitution.ADAPTER_RUN_STEP, substitution.ADAPTER_PORT))16# wait-for-storescp17verify_result(wait_for_port(substitution.STORE_SCP_RUN_STEP, substitution.STORE_SCP_PORT))18# run-store-scu19verify_result(run_store_scu(substitution.ADAPTER_RUN_STEP, substitution.ADAPTER_PORT, "../../../integration_test/data/example2.dcm"))20# close-adapter21runCommand("sudo kill -9 $(lsof -t -i:"+substitution.STORE_SCP_PORT+")", "Kill process on port "+ substitution.STORE_SCP_PORT)22runCommand("sudo kill -9 $(lsof -t -i:"+substitution.ADAPTER_PORT+")", "Kill process on port "+ substitution.ADAPTER_PORT)23# check-store-curl24verify_result(check_store_curl(substitution.VERSION, substitution.PROJECT, substitution.LOCATION, substitution.DATASET, STORE_NAME, substitution.REPLACED_UID_2, "integration_test/downloaded2.dcm"))25# check-store-diff26verify_result(check_diff("integration_test/downloaded2.dcm", "integration_test/data/example2.dcm"))27# delete-dicom-store28verify_result(delete_dicom_store(STORE_NAME, substitution.PROJECT, substitution.DATASET, substitution.LOCATION))29# delete-dicom-store destination-2...
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!!