diff options
author | Hector Fernandez <hector@iatec.biz> | 2020-06-25 11:45:31 +0200 |
---|---|---|
committer | Hector Fernandez <hector@iatec.biz> | 2020-06-25 11:45:31 +0200 |
commit | db3b1e45c47a1ef23c1ad67114a09cbec0976681 (patch) | |
tree | 6833ba2e59be77f9e818823068570ca3d51959cc /test-cli/test/helpers | |
parent | 278b5729a44837e37fe13611518c1babc8de00df (diff) | |
download | board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.zip board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.gz board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.bz2 |
Solved bugs. Adapted to DB changes.
Diffstat (limited to 'test-cli/test/helpers')
-rw-r--r-- | test-cli/test/helpers/testsrv_db.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test-cli/test/helpers/testsrv_db.py b/test-cli/test/helpers/testsrv_db.py index dfb4d15..637d45c 100644 --- a/test-cli/test/helpers/testsrv_db.py +++ b/test-cli/test/helpers/testsrv_db.py @@ -202,9 +202,21 @@ class TestSrv_Database(object): r = find_between(str(err), '#', '#') # print(r) return None - - def bond_to_station(self, uuid, station): - sql = "SELECT station.bond_to_station('{}','{}')".format(uuid, station) + + def read_station_state(self, station): + sql = "SELECT * FROM station.getmystate('{}');".format(station) + # print('>>>' + sql) + 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 + + def change_station_state(self, station, newstate): + sql = "SELECT station.setmystate('{}', '{}', NULL)".format(newstate, station) # print('>>>' + sql) try: self.__sqlObject.db_execute_query(sql) |