From 73f4078f5ad06f630f744c8f67300bc8e4522ca9 Mon Sep 17 00:00:00 2001 From: Auke Klazema <klazema@astron.nl> Date: Mon, 6 May 2019 13:07:56 +0000 Subject: [PATCH] SW-658: Fix Error message check in tests --- LCS/Messaging/python/messaging/test/t_messagebus.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LCS/Messaging/python/messaging/test/t_messagebus.py b/LCS/Messaging/python/messaging/test/t_messagebus.py index 6404845041d..87d871826ec 100644 --- a/LCS/Messaging/python/messaging/test/t_messagebus.py +++ b/LCS/Messaging/python/messaging/test/t_messagebus.py @@ -143,7 +143,7 @@ class FromBusInitFailed(unittest.TestCase): """ Connecting to non-existent broker address must raise MessageBusError """ - with self.assertRaisesRegex(MessageBusError, "Name or service not known"): + with self.assertRaisesRegex(MessageBusError, "No address associated with hostname"): with FromBus(self.test_queue.address, broker="foo.bar", auto_reconnect=False): pass @@ -151,7 +151,7 @@ class FromBusInitFailed(unittest.TestCase): """ Connecting to broker on wrong port must raise MessageBusError """ - with self.assertRaisesRegex(MessageBusError, "Connection refused"): + with self.assertRaisesRegex(MessageBusError, "recv: errno: 111"): with FromBus("fake" + self.test_queue.address, broker="localhost:4", auto_reconnect=False): pass @@ -195,7 +195,7 @@ class ToBusInitFailed(unittest.TestCase): """ Connecting to non-existent broker address must raise MessageBusError """ - with self.assertRaisesRegex(MessageBusError, "Name or service not known"): + with self.assertRaisesRegex(MessageBusError, "No address associated with hostname"): with ToBus(self.test_queue.address, broker="foo.bar", auto_reconnect=False): pass @@ -203,7 +203,7 @@ class ToBusInitFailed(unittest.TestCase): """ Connecting to broker on wrong port must raise MessageBusError """ - with self.assertRaisesRegex(MessageBusError, "Connection refused"): + with self.assertRaisesRegex(MessageBusError, "recv: errno: 111"): with ToBus(self.test_queue.address, broker="localhost:4", auto_reconnect=False): pass -- GitLab