XEP-0308: add tests
This commit is contained in:
26
tests/test_stanza_xep_0308.py
Normal file
26
tests/test_stanza_xep_0308.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import unittest
|
||||
from slixmpp import Message
|
||||
from slixmpp.test import SlixTest
|
||||
from slixmpp.plugins.xep_0308 import Replace
|
||||
from slixmpp.xmlstream import register_stanza_plugin
|
||||
|
||||
|
||||
class TestCorrectStanza(SlixTest):
|
||||
|
||||
def setUp(self):
|
||||
register_stanza_plugin(Message, Replace)
|
||||
|
||||
def testBuild(self):
|
||||
"""Test that the element is created correctly."""
|
||||
msg = Message()
|
||||
msg['type'] = 'chat'
|
||||
msg['replace']['id'] = 'toto123'
|
||||
|
||||
self.check(msg, """
|
||||
<message type="chat">
|
||||
<replace xmlns="urn:xmpp:message-correct:0" id="toto123"/>
|
||||
</message>
|
||||
""")
|
||||
|
||||
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(TestCorrectStanza)
|
||||
Reference in New Issue
Block a user