Exemplo n.º 1
0
    def setUp(self):
        self.cc = make_connected_client()
        self.cc.local_jid = TEST_FROM

        self.disco_client = aioxmpp.DiscoClient(self.cc)
        self.disco = aioxmpp.DiscoServer(self.cc)
        self.pubsub = aioxmpp.PubSubClient(
            self.cc, dependencies={aioxmpp.DiscoClient: self.disco_client})

        self.pep = aioxmpp.PEPClient(self.cc,
                                     dependencies={
                                         aioxmpp.DiscoClient:
                                         self.disco_client,
                                         aioxmpp.DiscoServer: self.disco,
                                         aioxmpp.PubSubClient: self.pubsub,
                                     })

        self.s = avatar_service.AvatarService(self.cc,
                                              dependencies={
                                                  aioxmpp.DiscoClient:
                                                  self.disco_client,
                                                  aioxmpp.DiscoServer:
                                                  self.disco,
                                                  aioxmpp.PubSubClient:
                                                  self.pubsub,
                                                  aioxmpp.PEPClient: self.pep,
                                              })

        self.cc.mock_calls.clear()
Exemplo n.º 2
0
    def setUp(self):
        self.cc = make_connected_client()
        self.cc.local_jid = TEST_FROM

        self.disco = aioxmpp.DiscoClient(self.cc)
        self.pubsub = aioxmpp.PubSubClient(
            self.cc, dependencies={aioxmpp.DiscoClient: self.disco})

        self.cc.mock_calls.clear()
Exemplo n.º 3
0
    def setUp(self):
        self.cc = make_connected_client()
        self.cc.local_jid = TEST_FROM

        self.disco_client = aioxmpp.DiscoClient(self.cc)
        self.disco_server = aioxmpp.DiscoServer(self.cc)
        self.pubsub = aioxmpp.PubSubClient(self.cc, dependencies={
            aioxmpp.DiscoClient: self.disco_client
        })

        self.s = pep.PEPClient(self.cc, dependencies={
            aioxmpp.DiscoClient: self.disco_client,
            aioxmpp.DiscoServer: self.disco_server,
            aioxmpp.PubSubClient: self.pubsub,
        })
Exemplo n.º 4
0
    def setUp(self):
        self.cc = make_connected_client()
        self.cc.local_jid = TEST_FROM

        self.disco_client = aioxmpp.DiscoClient(self.cc)
        self.disco = aioxmpp.DiscoServer(self.cc)
        self.presence_dispatcher = aioxmpp.dispatcher.SimplePresenceDispatcher(
            self.cc
        )
        self.presence_client = aioxmpp.PresenceClient(self.cc, dependencies={
            aioxmpp.dispatcher.SimplePresenceDispatcher:
                self.presence_dispatcher,
        })
        self.presence_server = aioxmpp.PresenceServer(self.cc)
        self.vcard = aioxmpp.vcard.VCardService(self.cc)

        self.pubsub = aioxmpp.PubSubClient(self.cc, dependencies={
            aioxmpp.DiscoClient: self.disco_client
        })

        self.pep = aioxmpp.PEPClient(self.cc, dependencies={
            aioxmpp.DiscoClient: self.disco_client,
            aioxmpp.DiscoServer: self.disco,
            aioxmpp.PubSubClient: self.pubsub,
        })

        self.s = avatar_service.AvatarService(self.cc, dependencies={
            aioxmpp.DiscoClient: self.disco_client,
            aioxmpp.DiscoServer: self.disco,
            aioxmpp.PubSubClient: self.pubsub,
            aioxmpp.PEPClient: self.pep,
            aioxmpp.PresenceClient: self.presence_client,
            aioxmpp.PresenceServer: self.presence_server,
            aioxmpp.vcard.VCardService: self.vcard
        })

        self.pep._check_for_pep = CoroutineMock()
        self.pep.available = CoroutineMock()
        self.pep.available.return_value = True

        self.cc.mock_calls.clear()