def test_listen_starts_service(self):
"""
``AutoTLSEndpoint.listen`` starts an ``AcmeIssuingService``. Stopping
the port stops the service.
"""
factory = Factory()
d = self.endpoint.listen(factory)
self.assertThat(
d,
succeeded(
MatchesPredicate(
IListeningPort.providedBy,
'%r does not provide IListeningPort')))
port = d.result
self.assertThat(
self.endpoint.service,
MatchesStructure(running=Equals(True)))
self.assertThat(port.stopListening(), succeeded(Always()))
self.assertThat(
self.endpoint.service,
MatchesStructure(running=Equals(False)))
评论列表
文章目录