def check_reception(self, header=None, data=None):
""" The method tests that the message is received correctly
or not received at all. """
if header and data:
# check that subscriber receives the message
try:
msg = self.subscriber.receive()
except zmq.Again:
self.fail('Failed to get {} status'.format(header))
self.assertTupleEqual((header, data), msg)
else:
# check the non-reception of the Supvisors status
with self.assertRaises(zmq.Again):
self.subscriber.receive()
评论列表
文章目录