Exemple #1
0
 def test_make_ServiceMonitorService(self):
     service = eventloop.make_ServiceMonitorService()
     self.assertThat(
         service, IsInstance(service_monitor_service.ServiceMonitorService))
     # It is registered as a factory in RegionEventLoop.
     self.assertIs(eventloop.make_ServiceMonitorService,
                   eventloop.loop.factories["service-monitor"]["factory"])
     self.assertEquals(
         [], eventloop.loop.factories["service-monitor"]["requires"])
     self.assertTrue(
         eventloop.loop.factories["service-monitor"]["only_on_master"])
Exemple #2
0
 def test_make_ServiceMonitorService(self):
     service = eventloop.make_ServiceMonitorService(sentinel.rpc_advertise)
     self.assertThat(
         service, IsInstance(service_monitor_service.ServiceMonitorService))
     # It is registered as a factory in RegionEventLoop.
     self.assertIs(eventloop.make_ServiceMonitorService,
                   eventloop.loop.factories["service-monitor"]["factory"])
     # Has a dependency of rpc-advertise.
     self.assertEquals(
         ["rpc-advertise"],
         eventloop.loop.factories["service-monitor"]["requires"])
     self.assertFalse(
         eventloop.loop.factories["service-monitor"]["only_on_master"])