示例#1
0
 def test_request_id(self):
     req = Request({'xmpp.id': 'xmppflask12345'})
     self.assertEqual(req.id, 'xmppflask12345')
示例#2
0
 def test_request_username_groupchat(self):
     jid = JID('user@domain/resource')
     req = Request({'xmpp.jid': jid, 'xmpp.stanza_type': 'groupchat'})
     self.assertEqual(req.username, 'resource')
示例#3
0
 def test_request_type(self):
     req = Request({'xmpp.stanza_type': 'available'})
     self.assertEqual(req.type, 'available')
示例#4
0
 def test_request_event(self):
     req = Request({'xmpp.stanza': 'presence'})
     self.assertEqual(req.event, 'presence')
示例#5
0
 def test_request_xml(self):
     req = Request({'xmpp.xml': '<message/>'})
     self.assertEqual(req.xml, '<message/>')
示例#6
0
 def test_request_body(self):
     req = Request({'xmpp.body': 'message'})
     self.assertEqual(req.body, 'message')
示例#7
0
 def test_request_app_jid(self):
     jid = JID('user@domain/resource')
     req = Request({'app.jid': jid})
     self.assertTrue(jid is req.app_jid)