From 49547dfabefaf6456f90de3080fb1f2b84b6d67a Mon Sep 17 00:00:00 2001 From: Auke Klazema <klazema@astron.nl> Date: Fri, 15 Mar 2019 09:55:32 +0000 Subject: [PATCH] SW-609: Fix code causing failing t_TreeStatusEvents test --- LCS/Messaging/python/messaging/messages.py | 3 +-- SAS/OTDB_Services/test/t_TreeStatusEvents.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/LCS/Messaging/python/messaging/messages.py b/LCS/Messaging/python/messaging/messages.py index 848dbe45432..af53ce9d808 100644 --- a/LCS/Messaging/python/messaging/messages.py +++ b/LCS/Messaging/python/messaging/messages.py @@ -240,8 +240,7 @@ class LofarMessage(object): result += "---\n" for key in _QPID_MESSAGE_FIELDS: - if (key != 'properties' and - self.__dict__['_qpid_msg'].__dict__[key] is not None): + if (key != 'properties' and key in self.__dict__['_qpid_msg'].__dict__.items()): result += "%s:%s\n" % (key, self.__dict__['_qpid_msg'].__dict__[key]) result += "===\n" return result diff --git a/SAS/OTDB_Services/test/t_TreeStatusEvents.py b/SAS/OTDB_Services/test/t_TreeStatusEvents.py index f8d27cdba34..dddda9a9b0d 100644 --- a/SAS/OTDB_Services/test/t_TreeStatusEvents.py +++ b/SAS/OTDB_Services/test/t_TreeStatusEvents.py @@ -84,7 +84,7 @@ if __name__ == "__main__": frombus.ack(msg) msg.show() try: - ok = (msg.content['treeID'] == 1099266 and msg.content['state'] == 'queued') + ok = (msg.body['treeID'] == 1099266 and msg.body['state'] == 'queued') except IndexError: ok = False -- GitLab