def test_request_id(self): req = Request({'xmpp.id': 'xmppflask12345'}) self.assertEqual(req.id, 'xmppflask12345')
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')
def test_request_type(self): req = Request({'xmpp.stanza_type': 'available'}) self.assertEqual(req.type, 'available')
def test_request_event(self): req = Request({'xmpp.stanza': 'presence'}) self.assertEqual(req.event, 'presence')
def test_request_xml(self): req = Request({'xmpp.xml': '<message/>'}) self.assertEqual(req.xml, '<message/>')
def test_request_body(self): req = Request({'xmpp.body': 'message'}) self.assertEqual(req.body, 'message')
def test_request_app_jid(self): jid = JID('user@domain/resource') req = Request({'app.jid': jid}) self.assertTrue(jid is req.app_jid)