blob: a052fced43c4558270c7f618480a1b7f7bf4bd5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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)
|