Exemplo n.º 1
0
 def setUp(self):
     self.gotAuthenticated = False
     self.initFailure = None
     self.authenticator = xmlstream.ConnectAuthenticator('otherHost')
     self.xmlstream = xmlstream.XmlStream(self.authenticator)
     self.xmlstream.addObserver('//event/stream/authd',
                                self.onAuthenticated)
     self.xmlstream.addObserver('//event/xmpp/initfailed',
                                self.onInitFailed)
Exemplo n.º 2
0
 def setUp(self):
     self.output = []
     self.authenticator = xmlstream.ConnectAuthenticator('example.org')
     self.xmlstream = xmlstream.XmlStream(self.authenticator)
     self.xmlstream.send = self.output.append
     self.xmlstream.connectionMade()
     self.xmlstream.dataReceived(
         "<stream:stream xmlns='jabber:client' "
         "xmlns:stream='http://etherx.jabber.org/streams' "
         "from='example.com' id='12345' version='1.0'>")
Exemplo n.º 3
0
 def __init__(self, network, token, peer=None):
     a = xmlstream.ConnectAuthenticator(network)
     f = xmlstream.XmlStreamFactory(a)
     f.addBootstrap(xmlstream.STREAM_CONNECTED_EVENT, self.connected)
     f.addBootstrap(xmlstream.STREAM_END_EVENT, self.disconnected)
     f.addBootstrap(xmlstream.STREAM_AUTHD_EVENT, self.authenticated)
     f.addBootstrap(xmlstream.INIT_FAILED_EVENT, self.init_failed)
     reactor.connectTCP('localhost', 5222, f)
     self.network = network
     self.peer = peer
Exemplo n.º 4
0
 def setUp(self):
     authenticator = xmlstream.ConnectAuthenticator('otherhost')
     authenticator.namespace = 'testns'
     self.xmlstream = xmlstream.XmlStream(authenticator)
     self.clock = task.Clock()
     self.xmlstream._callLater = self.clock.callLater
     self.xmlstream.makeConnection(proto_helpers.StringTransport())
     self.xmlstream.dataReceived(
         "<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "
         "xmlns='testns' from='otherhost' version='1.0'>")
     self.iq = xmlstream.IQ(self.xmlstream, 'get')
Exemplo n.º 5
0
    def setUp(self):
        self.outlist = []

        authenticator = xmlstream.ConnectAuthenticator('otherhost')
        authenticator.namespace = 'testns'
        self.xmlstream = xmlstream.XmlStream(authenticator)
        self.xmlstream.transport = self
        self.xmlstream.transport.write = self.outlist.append
        self.xmlstream.connectionMade()
        self.xmlstream.dataReceived(
            "<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "
            "xmlns='testns' from='otherhost' version='1.0'>")
        self.iq = xmlstream.IQ(self.xmlstream, type='get')
Exemplo n.º 6
0
    def setUp(self):
        self.output = []
        self.done = []

        self.savedSSL = xmlstream.ssl

        self.authenticator = xmlstream.ConnectAuthenticator(u'example.com')
        self.xmlstream = xmlstream.XmlStream(self.authenticator)
        self.xmlstream.send = self.output.append
        self.xmlstream.connectionMade()
        self.xmlstream.dataReceived("<stream:stream xmlns='jabber:client' "
                        "xmlns:stream='http://etherx.jabber.org/streams' "
                        "from='example.com' id='12345' version='1.0'>")
        self.init = xmlstream.TLSInitiatingInitializer(self.xmlstream)
Exemplo n.º 7
0
 def setUp(self):
     self.output = []
     self.pipe = utility.XmlPipe()
     self.xmlstream = self.pipe.sink
     self.authenticator = xmlstream.ConnectAuthenticator('example.org')
     self.xmlstream.authenticator = self.authenticator