summaryrefslogtreecommitdiff
path: root/tests/test_stanza_xep_0323.py
diff options
context:
space:
mode:
authorJoachim Lindborg <Joachim.Lindborg@lsys.se>2013-05-17 12:18:00 +0200
committerJoachim Lindborg <Joachim.Lindborg@lsys.se>2013-05-17 12:18:00 +0200
commitb7adaafb3ecb0a615c93fbb1830e66357b081fe3 (patch)
treed542dbb5263e6b5f21714916bd6b0061e3435842 /tests/test_stanza_xep_0323.py
parent0a2737dc77709daa0196340368b7ffbfaf71f641 (diff)
downloadslixmpp-b7adaafb3ecb0a615c93fbb1830e66357b081fe3.tar.gz
slixmpp-b7adaafb3ecb0a615c93fbb1830e66357b081fe3.tar.bz2
slixmpp-b7adaafb3ecb0a615c93fbb1830e66357b081fe3.tar.xz
slixmpp-b7adaafb3ecb0a615c93fbb1830e66357b081fe3.zip
First test stanza
Diffstat (limited to 'tests/test_stanza_xep_0323.py')
-rw-r--r--tests/test_stanza_xep_0323.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/test_stanza_xep_0323.py b/tests/test_stanza_xep_0323.py
new file mode 100644
index 00000000..a052fced
--- /dev/null
+++ b/tests/test_stanza_xep_0323.py
@@ -0,0 +1,57 @@
+from sleekxmpp.test import *
+import sleekxmpp.plugins.xep_0323 as xep_0323
+
+namespace='sn'
+
+class TestChatStates(SleekTest):
+
+
+ def setUp(self):
+ register_stanza_plugin(Message, xep_0323.stanza.Request)
+ register_stanza_plugin(Message, xep_0323.stanza.Accepted)
+ register_stanza_plugin(Message, xep_0323.stanza.Failure)
+ # register_stanza_plugin(Message, xep_0323.stanza.Result)
+ # register_stanza_plugin(Message, xep_0323.stanza.Gone)
+ # register_stanza_plugin(Message, xep_0323.stanza.Inactive)
+ # register_stanza_plugin(Message, xep_0323.stanza.Paused)
+
+ def testRequest(self):
+ """
+ test of request stanza
+ """
+ iq = self.Iq()
+ iq['type'] = 'get'
+ iq['id'] = '1'
+ iq['sensordata']['req']['seqnr'] = '1'
+ iq['sensordata']['req']['momentary'] = 'true'
+
+ self.check(iq,"""
+ """
+ )
+
+ def testAccepted(self):
+ """
+ test of request stanza
+ """
+ iq = self.Iq()
+ iq['type'] = 'result'
+ iq['id'] = '2'
+ iq['sensordata']['accepted']['seqnr'] = '2'
+
+ print(str(iq))
+ self.check(iq,"""
+ """
+ )
+
+ def testReadOutMomentary_multiple(self):
+ """
+ test of reading momentary value from a nde with multiple responses
+ """
+ iq = self.Iq()
+ print(str(iq))
+
+ self.check(iq,"""
+ """
+ )
+
+suite = unittest.TestLoader().loadTestsFromTestCase(TestChatStates)