

def test_defaultBuildProtocol(self):
    '\n        L{Factory.buildProtocol} by default constructs a protocol by calling\n        its C{protocol} attribute, and attaches the factory to the result.\n        '

    class SomeProtocol(Protocol):
        pass
    f = Factory()
    protocol.protocol = SomeProtocol
    protocol = f.buildProtocol(None)
    self.assertIsInstance(protocol, SomeProtocol)
    self.assertIs(protocol.factory, f)

dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_protocol.py FactoryTests.test_defaultBuildProtocol/VarMisuse@30/91 `f`->`protocol`