Index: tests/test_hd_simulator.py =================================================================== diff -u -r120e6925083c799b20143834e431bdc9f34c3687 -rf8e83b59e5f3b903abb1cb78969d858439420f59 --- tests/test_hd_simulator.py (.../test_hd_simulator.py) (revision 120e6925083c799b20143834e431bdc9f34c3687) +++ tests/test_hd_simulator.py (.../test_hd_simulator.py) (revision f8e83b59e5f3b903abb1cb78969d858439420f59) @@ -1,17 +1,18 @@ ########################################################################### # -# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# Copyright (c) 2020 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. +# 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_hd_simulator.py +# @file test_hd_simulator.py # -# @author (last) Peter Lucia -# @date (last) 28-Aug-2020 -# @author (original) Peter Lucia -# @date (original) 06-Aug-2020 +# @date 06-Aug-2020 +# @author P. Lucia # +# @brief +# +# ############################################################################ import sys sys.path.append("..") @@ -117,16 +118,30 @@ hd_simulator.cmd_send_priming_time_remaining(state, seconds_remaining, total_seconds) sleep(0.05) +class StartTreatmentObserver(AbstractObserver): + def __init__(self): + self.received_response = False + def update(self, result): + print(result) + self.received_response = True +def test_start_confirm_end_treatment(): + hd_simulator = HDSimulator(log_level="PRINT_ONLY") + observer = StartTreatmentObserver() + hd_simulator.attach(observer) + + while not observer.received_response: + sleep(0.50) + if __name__ == '__main__': # test_clear_alarms() # sleep(1) # test_poweroff() # test_valid_parameters() - test_priming() + # test_priming() + test_start_confirm_end_treatment() -