summaryrefslogtreecommitdiff
path: root/tests/test_stream_roster.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-05-20 21:12:53 -0400
committerLance Stout <lancestout@gmail.com>2011-05-20 21:12:53 -0400
commit4d3593ac8698676e3b4b987120c19db07c6a76bb (patch)
treea097c878923a5852ab602c5df3c3b770bea61582 /tests/test_stream_roster.py
parentc49a8e91142121251ccb2cacd3b3f0d5cd78db97 (diff)
parent6b274a2543744f9b94823f5bd2a6c23ec8cc3f75 (diff)
downloadslixmpp-4d3593ac8698676e3b4b987120c19db07c6a76bb.tar.gz
slixmpp-4d3593ac8698676e3b4b987120c19db07c6a76bb.tar.bz2
slixmpp-4d3593ac8698676e3b4b987120c19db07c6a76bb.tar.xz
slixmpp-4d3593ac8698676e3b4b987120c19db07c6a76bb.zip
Merge branch 'develop' into roster
Conflicts: tests/test_stream_roster.py
Diffstat (limited to 'tests/test_stream_roster.py')
-rw-r--r--tests/test_stream_roster.py41
1 files changed, 20 insertions, 21 deletions
diff --git a/tests/test_stream_roster.py b/tests/test_stream_roster.py
index f557e8b2..7f18c312 100644
--- a/tests/test_stream_roster.py
+++ b/tests/test_stream_roster.py
@@ -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)