plugin XEP-0313: first draft:
- you can already test it with d-feet but it will bug unless you apply the changeset 60dfa2f5d61f which is waiting in the branch "frontends_multi_profiles" (actually just one "assert" to comment in plugin_xep_0085.py)
This commit is contained in:
parent
01e8ee664e
commit
4a4760b80b
1 changed files with 505 additions and 1 deletions
|
|
@ -25,12 +25,14 @@ log_config.satConfigure()
|
|||
from sat.core import exceptions
|
||||
from constants import Const as C
|
||||
from wokkel.xmppim import RosterItem
|
||||
from wokkel.generic import parseXml
|
||||
from sat.core.xmpp import SatRosterProtocol
|
||||
from sat.memory.memory import Params, Memory
|
||||
from twisted.trial.unittest import FailTest
|
||||
from twisted.trial import unittest
|
||||
from twisted.internet import defer
|
||||
from twisted.words.protocols.jabber.jid import JID
|
||||
from twisted.words.xish import domish
|
||||
from xml.etree import cElementTree as etree
|
||||
from collections import Counter
|
||||
import re
|
||||
|
|
@ -355,10 +357,25 @@ class FakeXmlStream(object):
|
|||
self.sent = []
|
||||
|
||||
def send(self, obj):
|
||||
"""Save the sent messages to compare them later"""
|
||||
"""Save the sent messages to compare them later.
|
||||
|
||||
@param obj (domish.Element, str or unicode): message to send
|
||||
"""
|
||||
if not isinstance(obj, domish.Element):
|
||||
assert(isinstance(obj, str) or isinstance(obj, unicode))
|
||||
obj = parseXml(obj)
|
||||
|
||||
if obj.name == 'iq':
|
||||
# IQ request expects an answer, return the request itself so
|
||||
# you can check if it has been well built by your plugin.
|
||||
self.iqDeferreds[obj['id']].callback(obj)
|
||||
|
||||
self.sent.append(obj)
|
||||
return defer.succeed(None)
|
||||
|
||||
def addObserver(self, *argv):
|
||||
pass
|
||||
|
||||
|
||||
class FakeClient(object):
|
||||
"""Tests involving more than one profile need one instance of this class per profile"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue