From 8320773f18b60aaaf7f7f4201a2ec667e67ae459 Mon Sep 17 00:00:00 2001 From: Ruud Overeem <overeem@astron.nl> Date: Mon, 2 Nov 2015 13:42:02 +0000 Subject: [PATCH] Task #8531: Fixed tests. --- LCS/Messaging/python/messaging/test/t_RPC.py | 20 ++++++++++---------- SAS/OTDB_Services/TreeService.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/LCS/Messaging/python/messaging/test/t_RPC.py b/LCS/Messaging/python/messaging/test/t_RPC.py index 4b367e253b0..95f93317141 100644 --- a/LCS/Messaging/python/messaging/test/t_RPC.py +++ b/LCS/Messaging/python/messaging/test/t_RPC.py @@ -110,11 +110,11 @@ if __name__ == '__main__': busname = sys.argv[1] if len(sys.argv) > 1 else "simpletest" # Register functs as a service handler listening at busname and ServiceName - serv1 = Service(busname, "ErrorService", ErrorFunc, numthreads=1) - serv2 = Service(busname, "ExceptionService", ExceptionFunc, numthreads=1) - serv3 = Service(busname, "StringService", StringFunc, numthreads=1) - serv4 = Service(busname, "ListService", ListFunc, numthreads=1) - serv5 = Service(busname, "DictService", DictFunc, numthreads=1) + serv1 = Service("ErrorService", ErrorFunc, busname=busname, numthreads=1) + serv2 = Service("ExceptionService", ExceptionFunc, busname=busname, numthreads=1) + serv3 = Service("StringService", StringFunc, busname=busname, numthreads=1) + serv4 = Service("ListService", ListFunc, busname=busname, numthreads=1) + serv5 = Service("DictService", DictFunc, busname=busname, numthreads=1) # 'with' sets up the connection context and defines the scope of the service. with serv1, serv2, serv3, serv4, serv5: @@ -127,21 +127,21 @@ if __name__ == '__main__': # Redo all tests but via through RPC # ErrorFunc - with RPC(busname, "ErrorService") as rpc: + with RPC("ErrorService", busname=busname) as rpc: try: result = rpc("aap noot mies") except UserException as e: pass # ExceptionFunc - with RPC(busname, "ExceptionService") as rpc: + with RPC("ExceptionService", busname=busname) as rpc: try: result = rpc("aap noot mies") except IndexError as e: pass # StringFunc - with RPC(busname, "StringService") as rpc: + with RPC("StringService", busname=busname) as rpc: try: result = rpc([25]) except InvalidArgType as e: @@ -151,7 +151,7 @@ if __name__ == '__main__': raise Exception("String function failed:{}".format(result)) # ListFunc - with RPC(busname, "ListService") as rpc: + with RPC("ListService", busname=busname) as rpc: try: result = rpc("25") except InvalidArgType as e: @@ -161,7 +161,7 @@ if __name__ == '__main__': raise Exception("List function failed:{}".format(result)) # DictFunc - with RPC(busname, "DictService") as rpc: + with RPC("DictService", busname=busname) as rpc: try: result = rpc([25]) except InvalidArgType as e: diff --git a/SAS/OTDB_Services/TreeService.py b/SAS/OTDB_Services/TreeService.py index 77b1212238e..ce27dc471fd 100644 --- a/SAS/OTDB_Services/TreeService.py +++ b/SAS/OTDB_Services/TreeService.py @@ -210,7 +210,7 @@ class PostgressMessageHandlerInterface(MessageHandlerInterface): self.connection = None self.connected = False - def in_loop_before_receive(self): + def prepare_receive(self): "Called in main processing loop just before a blocking wait for messages is done." "Make sure we are connected with the database." self.connected = (self.connection and self.connection.status == 1) -- GitLab