def test_clientConnected(self):
        """
        When a client connects, the service keeps a reference to the new
        protocol and resets the delay.
        """
        clock = Clock()
        cq, service = self.makeReconnector(clock=clock)
        awaitingProtocol = service.whenConnected()
        self.assertEqual(clock.getDelayedCalls(), [])
        self.assertIdentical(self.successResultOf(awaitingProtocol),
                             cq.applicationProtocols[0])

        When a client connects, the service keeps a reference to the new
        protocol and resets the delay.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/test/test_internet.py