Index: tst_cloud_sync_hd_opmodes/test.py =================================================================== diff -u -rab6afa5f53b858d49e6abe58eb53babdf154523c -r536556f0a4507c2729bdab3e5d6aa5509b747009 --- tst_cloud_sync_hd_opmodes/test.py (.../test.py) (revision ab6afa5f53b858d49e6abe58eb53babdf154523c) +++ tst_cloud_sync_hd_opmodes/test.py (.../test.py) (revision 536556f0a4507c2729bdab3e5d6aa5509b747009) @@ -34,6 +34,7 @@ MESSAGE_ILLEGAL_TRANSITION_MODE = '1639391827,1,0,1006,2,8,1' MESSAGE_FAULT_MODE = '1658165998,14,0,1006,2,0,0' DEVICE_CREDENTIALS_RESPONSE = '1639391827,1,0,1004,1,/tmp/credentials/' +MESSAGE_TREATMENT_REPORT = '1658920211,18,0,1007,1,/home/denali/Desktop/sd-card/treatment/19691231_1600_1.log' def verify_hd_opmodes(): @@ -143,6 +144,54 @@ test.endSection() +def verify_treatment_report(): + """ + This function is used for verifying treatment response from CS. + """ + test.startSection("Verification of treatment report response from CS") + hd_simulator.cmd_send_post_treatment_log_response(accepted = 1, reason = 1, + bood_flow_rate = 1, + dialysate_flow_rate = 1, + treatment_duration = 1, + actual_treatment_duration = 1, + acid_concentrate_type = 1, + bicarbonate_concentrate_type = 1, + potassium_concentration = 1, + calcium_concentration = 1, + bicarbonate_concentration = 1, + sodium_concentration = 1, + dialysate_temperature = 1.0, + dialyzer_type = 1, + treatment_start_date_time = 1, + treatment_end_date_time = 1, + average_blood_flow = 1.0, + average_dialysate_flow = 1.0, + dialysate_volume_used = 1.0, + average_dialysate_temp = 1.0, + origin_uf_volume = 1.0, + target_uf_volume = 1.0, + actual_uf_volume = 1.0, + origin_uf_rate = 1.0, + target_uf_rate = 1.0, + actual_uf_rate = 1.0, + saline_bolus_volume = 1, + heparin_bolus_volume = 1.0, + heparin_dispense_rate = 1.0, + heparin_pre_stop = 1, + heparin_delivered_volume = 1.0, + heparin_type = 1, + average_arterial_pressure = 1.0, + average_venous_pressure = 1.0, + device_id = 1, + water_sample_test_result = 10) + utils.waitForGUI(1) + actual_inp_buf_data = utility.retrive_log_data() + expected_cloudsync_data = MESSAGE_TREATMENT_REPORT.split(',') + test.compare(actual_inp_buf_data[0][3],expected_cloudsync_data[3], "Treatment report code should be 1007") + test.compare(actual_inp_buf_data[0][5],expected_cloudsync_data[5], "Treatment report location should be -> "+MESSAGE_TREATMENT_REPORT[5]) + test.endSection() + + def verify_log_response(actual_cloudsync_data, expected_cloudsync_data): """ This function is used for verifying the expected and actual cloud-sync log data. @@ -172,6 +221,7 @@ utils.waitForGUI(2) verify_hd_opmodes() + verify_treatment_report() utils.tstDone() \ No newline at end of file