From cec34686fcfe09281931e977fcf322dac275aad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 27 May 2020 22:28:47 +0200 Subject: New XEP: 0421 Occupant-id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- tests/test_stanza_xep_0421.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/test_stanza_xep_0421.py (limited to 'tests/test_stanza_xep_0421.py') 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 = """ + + Some 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) -- cgit v1.2.3