From fdb0749cd14ea9480687d5e243ec8fc81731e4dd Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 4 Dec 2020 18:45:06 +0100 Subject: XEP-0422,0424,0425,0439: Add basic stanza tests --- tests/test_stanza_xep_0422.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/test_stanza_xep_0422.py (limited to 'tests/test_stanza_xep_0422.py') diff --git a/tests/test_stanza_xep_0422.py b/tests/test_stanza_xep_0422.py new file mode 100644 index 00000000..9d2cc396 --- /dev/null +++ b/tests/test_stanza_xep_0422.py @@ -0,0 +1,33 @@ +import unittest +from slixmpp import Message +from slixmpp.test import SlixTest +from slixmpp.xmlstream import ET +from slixmpp.plugins.xep_0422 import stanza + + +class TestFastening(SlixTest): + + def setUp(self): + stanza.register_plugins() + + def testFastenExternal(self): + message = Message() + message['apply_to']['id'] = 'some-id' + message['apply_to'].xml.append( + ET.fromstring('Test') + ) + message['apply_to']['external']['name'] = 'body' + message['body'] = 'Toto' + + self.check(message, """ + + + Test + + + Toto + + """, use_values=False) + + +suite = unittest.TestLoader().loadTestsFromTestCase(TestFastening) -- cgit v1.2.3