Index: tests/peter/test_POST.py =================================================================== diff -u -r33ca5c4128dec6677a0c8bd8e69e439521f6120a -r32e628abcbbd3fd70866505d9f2836a6f732ef06 --- tests/peter/test_POST.py (.../test_POST.py) (revision 33ca5c4128dec6677a0c8bd8e69e439521f6120a) +++ tests/peter/test_POST.py (.../test_POST.py) (revision 32e628abcbbd3fd70866505d9f2836a6f732ef06) @@ -1,41 +1,41 @@ ########################################################################### # -# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # -# @file test_post.py +# @file test_POST.py # -# @author (last) Peter Lucia -# @date (last) 21-Mar-2021 -# @author (original) Peter Lucia -# @date (original) 21-Mar-2021 +# @author (last) Peter Lucia +# @date (last) 06-Jun-2021 +# @author (original) Peter Lucia +# @date (original) 24-May-2021 # ############################################################################ -# in case PYTHONPATH is not set import sys sys.path.append("../../") from dialin import HDSimulator, DGSimulator from time import sleep +from dialin.common import HDOpModes, HDOpSubModes SUCCESS = 1 FAILURE = 0 NUM_HD_TESTS = 8 NUM_DG_TESTS = 6 hd_sim = HDSimulator(log_level="DEBUG") -dg_sim = DGSimulator(log_level="DEBUG") +dg_sim = DGSimulator() -for test_num in range(NUM_HD_TESTS-1): - hd_sim.cmd_send_hd_post_single_result(SUCCESS, test_num=test_num) - sleep(1) -hd_sim.cmd_send_hd_post_single_result(FAILURE, test_num=7) -hd_sim.cmd_send_hd_post_final_result(FAILURE) +# prompts UI to report version for the HD's version compatibility self test +hd_sim.cmd_send_power_on_self_test_version_request() -for test_num in range(NUM_DG_TESTS-1): - dg_sim.cmd_send_dg_post_single_result(SUCCESS, test_num=test_num) - sleep(1) -dg_sim.cmd_send_dg_post_single_result(FAILURE, test_num=5) -dg_sim.cmd_send_dg_post_final_result(FAILURE) +for _ in range(40): + hd_sim.cmd_set_hd_operation_mode_data(HDOpModes.MODE_INIT.value, HDOpSubModes.SUBMODE_START.value) + sleep(0.25) +dg_sim.cmd_send_dg_post_final_result(SUCCESS) +hd_sim.cmd_send_hd_post_final_result(SUCCESS) + +sleep(2) +hd_sim.cmd_set_hd_operation_mode_data(HDOpModes.MODE_STAN.value, HDOpSubModes.SUBMODE_START.value)