mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-12-27 03:00:14 +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 *
|
||||
import time
|
||||
|
@ -176,33 +178,30 @@ class TestStreamRoster(SleekTest):
|
|||
# Give the event queue time to process.
|
||||
time.sleep(.1)
|
||||
|
||||
roster = {'andré@foo': {
|
||||
'name': '',
|
||||
'subscription': 'both',
|
||||
'groups': ['Unicode'],
|
||||
'presence': {},
|
||||
'in_roster': True}}
|
||||
self.failUnless(self.xmpp.roster == roster,
|
||||
"Unexpected roster values: %s" % self.xmpp.roster)
|
||||
self.check_roster('tester@localhost', 'andré@foo',
|
||||
subscription='both',
|
||||
groups=['Unicode'])
|
||||
|
||||
jids = self.xmpp.client_roster.keys()
|
||||
self.failUnless(jids == ['andré@foo'],
|
||||
"Too many roster entries found: %s" % jids)
|
||||
|
||||
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.
|
||||
time.sleep(.1)
|
||||
|
||||
roster = {'andré@foo': {
|
||||
'name': '',
|
||||
'subscription': 'both',
|
||||
'groups': ['Unicode'],
|
||||
'presence': {
|
||||
'bar':{'priority':0,
|
||||
'status':'',
|
||||
'show':'available'}},
|
||||
'in_roster': True}}
|
||||
self.failUnless(self.xmpp.roster == roster,
|
||||
"Unexpected roster values: %s" % self.xmpp.roster)
|
||||
result = self.xmpp.client_roster['andré@foo'].resources
|
||||
expected = {'bar': {'status':'Testing',
|
||||
'show':'away',
|
||||
'priority':0}}
|
||||
self.failUnless(result == expected,
|
||||
"Unexpected roster values: %s" % result)
|
||||
|
||||
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamRoster)
|
||||
|
|
Loading…
Reference in a new issue