@@ -34,6 +34,10 @@ def on_track_listener(*args):
3434 pass
3535
3636
37+ def on_log_event_listener (* args ):
38+ pass
39+
40+
3741class NotificationCenterTest (unittest .TestCase ):
3842
3943 def test_add_notification_listener__valid_type (self ):
@@ -59,6 +63,11 @@ def test_add_notification_listener__valid_type(self):
5963 4 , test_notification_center .add_notification_listener (enums .NotificationTypes .TRACK , on_track_listener )
6064 )
6165
66+ self .assertEqual (
67+ 5 , test_notification_center .add_notification_listener (enums .NotificationTypes .LOG_EVENT ,
68+ on_log_event_listener )
69+ )
70+
6271 def test_add_notification_listener__multiple_listeners (self ):
6372 """ Test that multiple listeners of the same type can be successfully added. """
6473
@@ -138,6 +147,7 @@ def another_on_activate_listener(*args):
138147 self .assertEqual (2 , len (test_notification_center .notification_listeners [enums .NotificationTypes .ACTIVATE ]))
139148 self .assertEqual (1 , len (test_notification_center .notification_listeners [enums .NotificationTypes .DECISION ]))
140149 self .assertEqual (0 , len (test_notification_center .notification_listeners [enums .NotificationTypes .TRACK ]))
150+ self .assertEqual (0 , len (test_notification_center .notification_listeners [enums .NotificationTypes .LOG_EVENT ]))
141151
142152 # Remove one of the activate listeners and assert.
143153 self .assertTrue (test_notification_center .remove_notification_listener (3 ))
@@ -164,6 +174,10 @@ def another_on_activate_listener(*args):
164174 3 , test_notification_center .add_notification_listener (enums .NotificationTypes .ACTIVATE ,
165175 another_on_activate_listener )
166176 )
177+ self .assertEqual (
178+ 4 , test_notification_center .add_notification_listener (enums .NotificationTypes .LOG_EVENT ,
179+ on_log_event_listener )
180+ )
167181
168182 # Try removing a listener which does not exist.
169183 self .assertFalse (test_notification_center .remove_notification_listener (42 ))
@@ -180,6 +194,7 @@ def test_clear_notification_listeners(self):
180194 on_config_update_listener )
181195 test_notification_center .add_notification_listener (enums .NotificationTypes .DECISION , on_decision_listener )
182196 test_notification_center .add_notification_listener (enums .NotificationTypes .TRACK , on_track_listener )
197+ test_notification_center .add_notification_listener (enums .NotificationTypes .LOG_EVENT , on_log_event_listener )
183198
184199 # Assert all listeners are there:
185200 for notification_type in notification_center .NOTIFICATION_TYPES :
@@ -210,6 +225,7 @@ def test_clear_all_notification_listeners(self):
210225 on_config_update_listener )
211226 test_notification_center .add_notification_listener (enums .NotificationTypes .DECISION , on_decision_listener )
212227 test_notification_center .add_notification_listener (enums .NotificationTypes .TRACK , on_track_listener )
228+ test_notification_center .add_notification_listener (enums .NotificationTypes .LOG_EVENT , on_log_event_listener )
213229
214230 # Assert all listeners are there:
215231 for notification_type in notification_center .NOTIFICATION_TYPES :
0 commit comments