From 293f0682dd8258a068e4b152f9fecb292d732b78 Mon Sep 17 00:00:00 2001 From: Manel Caro Date: Mon, 5 Oct 2020 11:45:41 +0200 Subject: modify finish_test call, added execution without messsage if fails --- test-cli/test/helpers/testsrv_db.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test-cli/test/helpers/testsrv_db.py') diff --git a/test-cli/test/helpers/testsrv_db.py b/test-cli/test/helpers/testsrv_db.py index 556c246..8e96e8c 100644 --- a/test-cli/test/helpers/testsrv_db.py +++ b/test-cli/test/helpers/testsrv_db.py @@ -101,10 +101,11 @@ class TestSrv_Database(object): try: print('finish_test => SQL {}'.format(sql)) self.__sqlObject.db_execute_query(sql) + return True except Exception as err: r = find_between(str(err), '#', '#') print('finish_test => {}'.format(err)) - return None + return False def upload_result_file(self, testid_ctl, testid, desc, filepath, mimetype): try: @@ -246,3 +247,14 @@ class TestSrv_Database(object): r = find_between(str(err), '#', '#') # print(r) return default + + def setDevelStationState(self, station, newState): + sql = "UPDATE station.station_state SET state = {} WHERE hostname={}".format(newState, station) + try: + res = self.__sqlObject.db_execute_query(sql) + # print(res) + return res[0][0] + except Exception as err: + r = find_between(str(err), '#', '#') + # print(r) + return None -- cgit v1.1