diff options
author | Link Mauve <linkmauve@linkmauve.fr> | 2020-12-04 20:03:32 +0100 |
---|---|---|
committer | Link Mauve <linkmauve@linkmauve.fr> | 2020-12-04 20:03:32 +0100 |
commit | 05749c49690c00f2b1794212b2fb9281b6956a89 (patch) | |
tree | 06600402c84040badb8c51a84f683a2ca467ca13 /tests/test_stanza_xep_0422.py | |
parent | e592a46c99888594bfb0bf71da99c88755912a37 (diff) | |
parent | c2b09c5c8317d919d7df94b85ac92910de05904a (diff) | |
download | slixmpp-05749c49690c00f2b1794212b2fb9281b6956a89.tar.gz slixmpp-05749c49690c00f2b1794212b2fb9281b6956a89.tar.bz2 slixmpp-05749c49690c00f2b1794212b2fb9281b6956a89.tar.xz slixmpp-05749c49690c00f2b1794212b2fb9281b6956a89.zip |
Merge branch 'more-xeps' into 'master'
Add a batch of newer XEPs
See merge request poezio/slixmpp!69
Diffstat (limited to 'tests/test_stanza_xep_0422.py')
-rw-r--r-- | tests/test_stanza_xep_0422.py | 33 |
1 files changed, 33 insertions, 0 deletions
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 xmlns="urn:tmp:test">Test</test>') + ) + message['apply_to']['external']['name'] = 'body' + message['body'] = 'Toto' + + self.check(message, """ +<message> + <apply-to xmlns="urn:xmpp:fasten:0" id="some-id"> + <test xmlns="urn:tmp:test">Test</test> + <external name='body'/> + </apply-to> + <body>Toto</body> +</message> + """, use_values=False) + + +suite = unittest.TestLoader().loadTestsFromTestCase(TestFastening) |