summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-02-27 12:56:42 +0100
committermathieui <mathieui@mathieui.net>2021-02-27 13:21:13 +0100
commitbea2669907a1e9c3d9494ce3aed6e0779aa0f439 (patch)
treefb9f798854254414df217cfa185b836e265479bf /tests
parenta288094b64dba924d34567361164265d8763dbec (diff)
downloadslixmpp-bea2669907a1e9c3d9494ce3aed6e0779aa0f439.tar.gz
slixmpp-bea2669907a1e9c3d9494ce3aed6e0779aa0f439.tar.bz2
slixmpp-bea2669907a1e9c3d9494ce3aed6e0779aa0f439.tar.xz
slixmpp-bea2669907a1e9c3d9494ce3aed6e0779aa0f439.zip
XEP-0403: Add stanza tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_stanza_xep_0403.py32
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)