diff options
author | mathieui <mathieui@mathieui.net> | 2020-05-28 00:35:48 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2020-05-28 00:35:48 +0200 |
commit | bb61f0f39dfba205282dab50c0f3a47b26145c74 (patch) | |
tree | 5d55cb9e2ce386273c188f840a3fb6ce713524f7 /tests/test_stanza_xep_0421.py | |
parent | 6f4e9b485f743bc55ab0c2ae08afcdae89451110 (diff) | |
parent | a29ce4b54774de050f352606d06bb111ecff4a65 (diff) | |
download | slixmpp-bb61f0f39dfba205282dab50c0f3a47b26145c74.tar.gz slixmpp-bb61f0f39dfba205282dab50c0f3a47b26145c74.tar.bz2 slixmpp-bb61f0f39dfba205282dab50c0f3a47b26145c74.tar.xz slixmpp-bb61f0f39dfba205282dab50c0f3a47b26145c74.zip |
Merge branch 'xep-0421' into 'master'
New XEP: 0421 Occupant-id
See merge request poezio/slixmpp!55
Diffstat (limited to 'tests/test_stanza_xep_0421.py')
-rw-r--r-- | tests/test_stanza_xep_0421.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_stanza_xep_0421.py b/tests/test_stanza_xep_0421.py new file mode 100644 index 00000000..dbd7a592 --- /dev/null +++ b/tests/test_stanza_xep_0421.py @@ -0,0 +1,29 @@ +import unittest +from slixmpp import JID, Message +from slixmpp.test import SlixTest +import slixmpp.plugins.xep_0421 as xep_0421 +from slixmpp.xmlstream import register_stanza_plugin + + +class TestOccupantId(SlixTest): + + def setUp(self): + register_stanza_plugin(Message, xep_0421.stanza.OccupantId) + + def testReadOccupantId(self): + result = """ + <message type='groupchat' from='foo@muc/nick1'> + <body>Some message</body> + <occupant-id xmlns='urn:xmpp:occupant-id:0' id='unique-id1'/> + </message> + """ + + msg = self.Message() + msg['type'] = 'groupchat' + msg['from'] = JID('foo@muc/nick1') + msg['body'] = 'Some message' + msg['occupant-id']['id'] = 'unique-id1' + + self.check(msg, result) + +suite = unittest.TestLoader().loadTestsFromTestCase(TestOccupantId) |