def _new_registered_event(self):
     return event.ServiceRegisteredEvent(
         self._service_name,
         self._service_id,
         self._advertise_address,
         self._advertise_port,
         self._tags,
     )
Ejemplo n.º 2
0
    def test_that_register_sends_a_service_registered_event_when_registered(
            self):
        with patch.object(self.registerer, '_send_msg') as send_msg:
            self.registerer.register()

            expected_message = event.ServiceRegisteredEvent(
                self.service_name, self.service_id, 'localhost', 4242,
                [UUID, self.service_name])

            send_msg.assert_called_once_with(expected_message)