def test_logstrClientSetup(self):
        """
        Check that the log customization of the client transport happens
        once the client is connected.
        """
        server = MyServerFactory()

        client = MyClientFactory()
        client.protocolConnectionMade = defer.Deferred()

        port = reactor.listenTCP(0, server, interface='127.0.0.1')
        self.addCleanup(port.stopListening)

        connector = reactor.connectTCP(
            port.getHost().host, port.getHost().port, client)
        self.addCleanup(connector.disconnect)

        # It should still have the default value
        self.assertEqual(connector.transport.logstr,
                          "Uninitialized")

        def cb(ign):
            self.assertEqual(connector.transport.logstr,
                              "AccumulatingProtocol,client")
        client.protocolConnectionMade.addCallback(cb)
        return client.protocolConnectionMade

        Check that the log customization of the client transport happens
        once the client is connected.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_tcp.py