From 65aa6573df3a8f298e7df96473014c19216971ef Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 26 Oct 2010 23:47:17 -0400 Subject: First pass at integrating the new roster manager. --- sleekxmpp/test/sleektest.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'sleekxmpp/test') diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py index 2901e59b..cf38e78f 100644 --- a/sleekxmpp/test/sleektest.py +++ b/sleekxmpp/test/sleektest.py @@ -138,6 +138,33 @@ class SleekTest(unittest.TestCase): self.assertEqual(str(jid), string, "String does not match: %s" % str(jid)) + def check_roster(self, owner, jid, name=None, subscription=None, + afrom=None, ato=None, pending_out=None, pending_in=None, + groups=None): + roster = self.xmpp.rosters[owner][jid] + print roster._state + if name is not None: + self.assertEqual(roster['name'], name, + "Incorrect name value: %s" % roster['name']) + if subscription is not None: + self.assertEqual(roster['subscription'], subscription, + "Incorrect subscription: %s" % roster['subscription']) + if afrom is not None: + self.assertEqual(roster['from'], afrom, + "Incorrect from state: %s" % roster['from']) + if ato is not None: + self.assertEqual(roster['to'], ato, + "Incorrect to state: %s" % roster['to']) + if pending_out is not None: + self.assertEqual(roster['pending_out'], pending_out, + "Incorrect pending_out state: %s" % roster['pending_out']) + if pending_in is not None: + self.assertEqual(roster['pending_in'], pending_out, + "Incorrect pending_in state: %s" % roster['pending_in']) + if groups is not None: + self.assertEqual(roster['groups'], groups, + "Incorrect groups: %s" % roster['groups']) + # ------------------------------------------------------------------ # Methods for comparing stanza objects to XML strings -- cgit v1.2.3