XEP-0403: Add stanza tests
This commit is contained in:
parent
a288094b64
commit
bea2669907
1 changed files with 32 additions and 0 deletions
32
tests/test_stanza_xep_0403.py
Normal file
32
tests/test_stanza_xep_0403.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
import unittest
|
||||
from slixmpp import Presence, JID
|
||||
from slixmpp.test import SlixTest
|
||||
from slixmpp.plugins.xep_0403 import stanza
|
||||
|
||||
|
||||
class TestMIXPresenceStanza(SlixTest):
|
||||
|
||||
def setUp(self):
|
||||
stanza.register_plugins()
|
||||
|
||||
def testMIXPresence(self):
|
||||
"""Test that data is converted to base64"""
|
||||
pres = Presence()
|
||||
pres['show'] = 'dnd'
|
||||
pres['status'] = 'Hey there!'
|
||||
pres['mix']['jid'] = JID('toto@example.com')
|
||||
pres['mix']['nick'] = 'Toto toto'
|
||||
|
||||
self.check(pres, """
|
||||
<presence>
|
||||
<show>dnd</show>
|
||||
<status>Hey there!</status>
|
||||
<mix xmlns="urn:xmpp:mix:presence:0">
|
||||
<jid>toto@example.com</jid>
|
||||
<nick>Toto toto</nick>
|
||||
</mix>
|
||||
</presence>
|
||||
""")
|
||||
|
||||
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(TestMIXPresenceStanza)
|
Loading…
Reference in a new issue