def prebind(self): b_client = BOSHClient(self.jid, self.jpassword, self.bosh) session = b_client.startSession() if session: if type(session) == tuple: return session[1], session[1] return b_client.rid, b_client.sid return '', ''
def test_bosh_authentication(self): jid = JID('admin@localhost') jid.resource = str(random.randint(0, 1000)) client = BOSHClient(jid, 'admin', 'http://localhost:5280/http-bind/') self.assertTrue(client.startSession()) rid = client.rid sid = client.sid self.assertTrue(rid is not None) self.assertTrue(sid is not None)