4 from slixmpp
.test
import SlixTest
7 class TestStreamDirectInvite(SlixTest
):
10 Test using the XEP-0249 plugin.
16 def testReceiveInvite(self
):
17 self
.stream_start(mode
='client',
23 def handle_invite(msg
):
26 self
.xmpp
.add_event_handler('groupchat_direct_invite',
31 <x xmlns="jabber:x:conference"
32 jid="sleek@conference.jabber.org"
34 reason="For testing" />
40 self
.failUnless(events
== [True],
41 "Event not raised: %s" % events
)
43 def testSentDirectInvite(self
):
44 self
.stream_start(mode
='client',
48 self
.xmpp
['xep_0249'].send_invitation('user@example.com',
49 'sleek@conference.jabber.org',
50 reason
='Need to test Slixmpp')
53 <message to="user@example.com">
54 <x xmlns="jabber:x:conference"
55 jid="sleek@conference.jabber.org"
56 reason="Need to test Slixmpp" />
61 suite
= unittest
.TestLoader().loadTestsFromTestCase(TestStreamDirectInvite
)