diff options
author | mathieui <mathieui@mathieui.net> | 2021-02-27 21:02:03 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-02-27 21:02:03 +0100 |
commit | 9f1ded7f5f9b0dfebce943cc23b9f3435ad82e6e (patch) | |
tree | fb9f798854254414df217cfa185b836e265479bf /tests/test_stanza_xep_0403.py | |
parent | 059cb290d8ae567ef189d83c45a1e38b1f3ab9dc (diff) | |
parent | bea2669907a1e9c3d9494ce3aed6e0779aa0f439 (diff) | |
download | slixmpp-9f1ded7f5f9b0dfebce943cc23b9f3435ad82e6e.tar.gz slixmpp-9f1ded7f5f9b0dfebce943cc23b9f3435ad82e6e.tar.bz2 slixmpp-9f1ded7f5f9b0dfebce943cc23b9f3435ad82e6e.tar.xz slixmpp-9f1ded7f5f9b0dfebce943cc23b9f3435ad82e6e.zip |
Merge branch 'more-tests' into 'master'
Add some more tests for MIX, and fix a small bug
See merge request poezio/slixmpp!141
Diffstat (limited to 'tests/test_stanza_xep_0403.py')
-rw-r--r-- | tests/test_stanza_xep_0403.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_stanza_xep_0403.py b/tests/test_stanza_xep_0403.py new file mode 100644 index 00000000..7d7a5daa --- /dev/null +++ b/tests/test_stanza_xep_0403.py @@ -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) |