self.__msgq.register_socket(sock)
lname = self.__msgq.fd_to_lname[1] # Steal the lname
self.assertEqual([('connected', {'client': lname})], notifications)
- notifications.clear()
+ del notifications[:]
# A notification should happen for a subscription to a group
self.__msgq.process_command_subscribe(sock, {'group': 'G',
None)
self.assertEqual([('subscribed', {'client': lname, 'group': 'G'})],
notifications)
- notifications.clear()
+ del notifications[:]
# As well for unsubscription
self.__msgq.process_command_unsubscribe(sock, {'group': 'G',
None)
self.assertEqual([('unsubscribed', {'client': lname, 'group': 'G'})],
notifications)
- notifications.clear()
+ del notifications[:]
# Unsubscription from a group it isn't subscribed to
self.__msgq.process_command_unsubscribe(sock, {'group': 'H',
self.__msgq.process_command_subscribe(sock, {'group': 'G',
'instance': '*'},
None)
- notifications.clear()
+ del notifications[:]
self.__msgq.kill_socket(sock.fileno(), sock)
# Now, the notification for unsubscribe should be first, second for