Index: tst_cloud_sync_hd_opmode/test.py =================================================================== diff -u -ra20cd43aecdf785029b1d01c5e224b1e1728261e -r2d54b879d634338369136c10ce390211e8a6d713 --- tst_cloud_sync_hd_opmode/test.py (.../test.py) (revision a20cd43aecdf785029b1d01c5e224b1e1728261e) +++ tst_cloud_sync_hd_opmode/test.py (.../test.py) (revision 2d54b879d634338369136c10ce390211e8a6d713) @@ -14,9 +14,12 @@ # # NOTE: # This test verifies the cloud sync - Hd opmodes. - +import builtins import csv +import datetime import os +from builtins import int as pyInt +from builtins import str as pyStr from dialin.ui.hd_simulator import HDSimulator from dialin.ui import utils from configuration import utility @@ -25,21 +28,19 @@ from dialin.utils.conversions import float_to_bytearray, integer_to_bytearray,unsigned_integer_to_bytearray + hd_simulator = HDSimulator() CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync' -MESSAGE_1 = '1639391827,1,0,2008,1,Tx_code' +#MESSAGE_1 = '1639391827,1,0,2006,0' +NUM_OF_HD_OPMODES = [0,1,2,3,4,5,6,7,8] +NUM_OF_SUBMODES = 0 +MESSAGE_2 = '1639391827,1,0,1006,2,0,0' PEM_FILES = ['1.pem', '2.pem', '3.pem' ] -CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' -CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync/' -MESSAGE_1 = '1639391827,1,0,2008,1,Tx_code' - -PEM_FILES = ['1.pem', '2.pem', '3.pem' ] - def get_cloud_sync_input_file(): """ This function is the handler for getting file from log folder. @@ -53,7 +54,6 @@ except: return False - def get_cloud_sync_output_file(): """ This function is the handler for getting file from log folder. @@ -67,6 +67,7 @@ except: return False + def append_cloudsync_credentials_file(): try: @@ -135,14 +136,25 @@ test.fail("Log file is not created or log file is not created based on standard log naming format.") -# def set_data_in_cloud_sync_output_file(location, message): +def set_data_in_cloud_sync_output_file(location, message): + """ + This function is capable to write message into cloud sync folder. + + Through this method file reader act as a handler and it will write custom messages into {current_date}_out.buf + """ + with open(location, "a") as filereader: + filereader.write(message) + utils.waitForGUI(5) +# def set_data_in_cloud_sync_input_file(location, message): # """ # This function is capable to write message into cloud sync folder. -# +# # Through this method file reader act as a handler and it will write custom messages into {current_date}_out.buf # """ -# with open(LOCATION, "a") as filereader: -# filereader.write(UNHANDLED_MESSAGE[message]) +# with open(location, "r") as filereader: +# test.log(message) +# filereader.read(message) +# test.log(message) # utils.waitForGUI(5) @@ -157,5 +169,12 @@ utils.waitForGUI(1.5) navigate_to_hd_opmode_() cloud_out_log = get_cloud_sync_output_file() - set_data_in_cloud_sync_output_file(cloud_out_log, MESSAGE_1) - retrive_log_data \ No newline at end of file + set_data_in_cloud_sync_output_file(cloud_out_log, MESSAGE_2) +# cloud_out_log = get_cloud_sync_input_file() +# set_data_in_cloud_sync_input_file(cloud_out_log, MESSAGE_2) +# utils.waitForGUI(1) +# set_data_in_cloud_sync_input_file(cloud_out_log, MESSAGE_2) + set_data_in_cloud_sync_output_file(cloud_out_log, MESSAGE_2) + retrive_log_data() + + utils.tstDone() \ No newline at end of file