'The authenticator factory should be used to instantiate the
authenticator and pass it to the protocol.
The default protocol, L{XmlStream} stores the authenticator it is
passed, and calls its C{associateWithStream} method. so we use that to
check whether our authenticator factory is used and the protocol
instance gets an authenticator.'

def test_buildProtocolAuthenticatorInstantiation(self):

    xs = self.factory.buildProtocol(None)
    self.assertEqual([xs], xs.authenticator.xmlstreams)
