mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
Merge branch 'develop' into roster
Conflicts: tests/test_stream_roster.py
This commit is contained in:
commit
4d3593ac86
1 changed files with 20 additions and 21 deletions
|
@ -1,4 +1,6 @@
|
||||||
# -*- encoding:utf8 -*-
|
# -*- encoding:utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from sleekxmpp.test import *
|
from sleekxmpp.test import *
|
||||||
import time
|
import time
|
||||||
|
@ -176,33 +178,30 @@ class TestStreamRoster(SleekTest):
|
||||||
# Give the event queue time to process.
|
# Give the event queue time to process.
|
||||||
time.sleep(.1)
|
time.sleep(.1)
|
||||||
|
|
||||||
roster = {'andré@foo': {
|
self.check_roster('tester@localhost', 'andré@foo',
|
||||||
'name': '',
|
subscription='both',
|
||||||
'subscription': 'both',
|
groups=['Unicode'])
|
||||||
'groups': ['Unicode'],
|
|
||||||
'presence': {},
|
jids = self.xmpp.client_roster.keys()
|
||||||
'in_roster': True}}
|
self.failUnless(jids == ['andré@foo'],
|
||||||
self.failUnless(self.xmpp.roster == roster,
|
"Too many roster entries found: %s" % jids)
|
||||||
"Unexpected roster values: %s" % self.xmpp.roster)
|
|
||||||
|
|
||||||
self.recv("""
|
self.recv("""
|
||||||
<presence from="andré@foo/bar" />
|
<presence to="tester@localhost" from="andré@foo/bar">
|
||||||
|
<show>away</show>
|
||||||
|
<status>Testing</status>
|
||||||
|
</presence>
|
||||||
""")
|
""")
|
||||||
|
|
||||||
# Give the event queue time to process.
|
# Give the event queue time to process.
|
||||||
time.sleep(.1)
|
time.sleep(.1)
|
||||||
|
|
||||||
roster = {'andré@foo': {
|
result = self.xmpp.client_roster['andré@foo'].resources
|
||||||
'name': '',
|
expected = {'bar': {'status':'Testing',
|
||||||
'subscription': 'both',
|
'show':'away',
|
||||||
'groups': ['Unicode'],
|
'priority':0}}
|
||||||
'presence': {
|
self.failUnless(result == expected,
|
||||||
'bar':{'priority':0,
|
"Unexpected roster values: %s" % result)
|
||||||
'status':'',
|
|
||||||
'show':'available'}},
|
|
||||||
'in_roster': True}}
|
|
||||||
self.failUnless(self.xmpp.roster == roster,
|
|
||||||
"Unexpected roster values: %s" % self.xmpp.roster)
|
|
||||||
|
|
||||||
|
|
||||||
suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamRoster)
|
suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamRoster)
|
||||||
|
|
Loading…
Reference in a new issue