From d0c506f93010f62cd447ce29f98ab991f521ec99 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Fri, 5 Nov 2010 14:45:58 -0400 Subject: Simplified SleekTest. * check_stanza does not require stanza_class parameter. Introspection! * check_message, check_iq, and check_presence removed -- use check instead. * stream_send_stanza, stream_send_message, stream_send_iq, and stream_send_presence removed -- use send instead. * Use recv instead of recv_message, recv_presence, etc. * check_jid instead of check_JID * stream_start may accept multi=True to return a new SleekTest instance for testing multiple streams at once. --- tests/test_stanza_xep_0060.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'tests/test_stanza_xep_0060.py') diff --git a/tests/test_stanza_xep_0060.py b/tests/test_stanza_xep_0060.py index 32ee37a1..5d455236 100644 --- a/tests/test_stanza_xep_0060.py +++ b/tests/test_stanza_xep_0060.py @@ -16,7 +16,7 @@ class TestPubsubStanzas(SleekTest): aff2['affiliation'] = 'publisher' iq['pubsub']['affiliations'].append(aff1) iq['pubsub']['affiliations'].append(aff2) - self.check_iq(iq, """ + self.check(iq, """ @@ -38,7 +38,7 @@ class TestPubsubStanzas(SleekTest): sub2['subscription'] = 'subscribed' iq['pubsub']['subscriptions'].append(sub1) iq['pubsub']['subscriptions'].append(sub2) - self.check_iq(iq, """ + self.check(iq, """ @@ -55,7 +55,7 @@ class TestPubsubStanzas(SleekTest): iq['pubsub']['subscription']['node'] = 'testnode alsdkjfas' iq['pubsub']['subscription']['jid'] = "fritzy@netflint.net/sleekxmpp" iq['pubsub']['subscription']['subscription'] = 'unconfigured' - self.check_iq(iq, """ + self.check(iq, """ @@ -88,7 +88,7 @@ class TestPubsubStanzas(SleekTest): item2['payload'] = payload2 iq['pubsub']['items'].append(item) iq['pubsub']['items'].append(item2) - self.check_iq(iq, """ + self.check(iq, """ @@ -115,7 +115,7 @@ class TestPubsubStanzas(SleekTest): iq['pubsub']['configure']['form'].addField('pubsub#title', ftype='text-single', value='This thing is awesome') - self.check_iq(iq, """ + self.check(iq, """ @@ -136,7 +136,7 @@ class TestPubsubStanzas(SleekTest): iq['psstate']['item']= 'myitem' pl = ET.Element('{http://andyet.net/protocol/pubsubqueue}claimed') iq['psstate']['payload'] = pl - self.check_iq(iq, """ + self.check(iq, """ @@ -152,7 +152,7 @@ class TestPubsubStanzas(SleekTest): iq['pubsub_owner']['default']['form'].addField('pubsub#title', ftype='text-single', value='This thing is awesome') - self.check_iq(iq, """ + self.check(iq, """ @@ -176,7 +176,7 @@ class TestPubsubStanzas(SleekTest): form = xep_0004.Form() form.addField('pubsub#title', ftype='text-single', value='this thing is awesome') iq['pubsub']['subscribe']['options']['options'] = form - self.check_iq(iq, """ + self.check(iq, """ @@ -214,7 +214,7 @@ class TestPubsubStanzas(SleekTest): iq['pubsub']['publish'].append(item) iq['pubsub']['publish'].append(item2) - self.check_iq(iq, """ + self.check(iq, """ @@ -238,7 +238,7 @@ class TestPubsubStanzas(SleekTest): "Testing iq/pubsub_owner/delete stanzas" iq = self.Iq() iq['pubsub_owner']['delete']['node'] = 'thingers' - self.check_iq(iq, """ + self.check(iq, """ @@ -300,7 +300,7 @@ class TestPubsubStanzas(SleekTest): 'label': 'Deliver notification only to available users'}), ]) - self.check_iq(iq, """ + self.check(iq, """ @@ -357,7 +357,7 @@ class TestPubsubStanzas(SleekTest): msg['pubsub_event']['items'].append(item) msg['pubsub_event']['items']['node'] = 'cheese' msg['type'] = 'normal' - self.check_message(msg, """ + self.check(msg, """ @@ -383,7 +383,7 @@ class TestPubsubStanzas(SleekTest): msg['pubsub_event']['items'].append(item2) msg['pubsub_event']['items']['node'] = 'cheese' msg['type'] = 'normal' - self.check_message(msg, """ + self.check(msg, """ @@ -415,7 +415,7 @@ class TestPubsubStanzas(SleekTest): msg['pubsub_event']['items'].append(item2) msg['pubsub_event']['items']['node'] = 'cheese' msg['type'] = 'normal' - self.check_message(msg, """ + self.check(msg, """ @@ -435,7 +435,7 @@ class TestPubsubStanzas(SleekTest): msg['pubsub_event']['collection']['associate']['node'] = 'cheese' msg['pubsub_event']['collection']['node'] = 'cheeseburger' msg['type'] = 'headline' - self.check_message(msg, """ + self.check(msg, """ @@ -450,7 +450,7 @@ class TestPubsubStanzas(SleekTest): msg['pubsub_event']['collection']['disassociate']['node'] = 'cheese' msg['pubsub_event']['collection']['node'] = 'cheeseburger' msg['type'] = 'headline' - self.check_message(msg, """ + self.check(msg, """ @@ -467,7 +467,7 @@ class TestPubsubStanzas(SleekTest): ftype='text-single', value='This thing is awesome') msg['type'] = 'headline' - self.check_message(msg, """ + self.check(msg, """ @@ -485,7 +485,7 @@ class TestPubsubStanzas(SleekTest): msg = self.Message() msg['pubsub_event']['purge']['node'] = 'pickles' msg['type'] = 'headline' - self.check_message(msg, """ + self.check(msg, """ @@ -501,7 +501,7 @@ class TestPubsubStanzas(SleekTest): msg['pubsub_event']['subscription']['subscription'] = 'subscribed' msg['pubsub_event']['subscription']['expiry'] = 'presence' msg['type'] = 'headline' - self.check_message(msg, """ + self.check(msg, """ -- cgit v1.2.3