diff options
author | Lance Stout <lancestout@gmail.com> | 2010-10-26 23:47:17 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-11-17 01:49:19 -0500 |
commit | 673545c7e48d86b02f811ad239ed317e4bca0bbc (patch) | |
tree | 4a9d99fdb23b5ba0bc168b371a029b353256b54b /sleekxmpp/test | |
parent | 45991e47eeab97f0411139c5b1627ac6350de3d0 (diff) | |
download | slixmpp-673545c7e48d86b02f811ad239ed317e4bca0bbc.tar.gz slixmpp-673545c7e48d86b02f811ad239ed317e4bca0bbc.tar.bz2 slixmpp-673545c7e48d86b02f811ad239ed317e4bca0bbc.tar.xz slixmpp-673545c7e48d86b02f811ad239ed317e4bca0bbc.zip |
First pass at integrating the new roster manager.
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r-- | sleekxmpp/test/sleektest.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py index f8b4b546..c481d73b 100644 --- a/sleekxmpp/test/sleektest.py +++ b/sleekxmpp/test/sleektest.py @@ -137,6 +137,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 |