def testHandleEvent(self, notify_android_mock): d = self.monitor.persons[0].devices[0] d_copy = Device.from_json_string(d.to_json()) d_copy.status = 'online' self.monitor.handle_event(device_status_change(d_copy.to_json())) self.assertTrue(notify_android_mock.called)
def _notify_listeners(self, devices): for device in devices: device.toggle_status() self.debug(device.to_json()) broadcast_event( events.device_status_change( device.to_json()))