Exemple #1
0
 def test_make_WebApplicationService(self):
     service = eventloop.make_WebApplicationService(
         FakePostgresListenerService(), sentinel.status_worker)
     self.assertThat(service, IsInstance(webapp.WebApplicationService))
     # The port is set to port 5243 on localhost.
     self.assertThat(service.port, Equals(DEFAULT_PORT))
     # It is registered as a factory in RegionEventLoop.
     self.assertIs(eventloop.make_WebApplicationService,
                   eventloop.loop.factories["web"]["factory"])
     # Has a dependency of postgres-listener.
     self.assertEquals(["postgres-listener-worker", "status-worker"],
                       eventloop.loop.factories["web"]["requires"])
     self.assertFalse(eventloop.loop.factories["web"]["only_on_master"])
Exemple #2
0
 def test_make_WebApplicationService(self):
     service = eventloop.make_WebApplicationService(
         FakePostgresListenerService(), sentinel.status_worker)
     self.assertThat(service, IsInstance(webapp.WebApplicationService))
     # The endpoint is set to port 5243 on localhost.
     self.assertThat(
         service.endpoint,
         MatchesStructure.byEquality(reactor=reactor,
                                     addressFamily=socket.AF_INET6))
     self.assertThat(service.endpoint.port, Equals(DEFAULT_PORT))
     # IPv6 address is: (host, port, flowinfo, scopeid)
     self.assertThat(service.endpoint.socket.getsockname(),
                     Equals(("::", DEFAULT_PORT, 0, 0)))
     # It is registered as a factory in RegionEventLoop.
     self.assertIs(eventloop.make_WebApplicationService,
                   eventloop.loop.factories["web"]["factory"])
     # Has a dependency of postgres-listener.
     self.assertEquals(["postgres-listener-worker", "status-worker"],
                       eventloop.loop.factories["web"]["requires"])
     self.assertFalse(eventloop.loop.factories["web"]["only_on_master"])