def test_get_transport_message_tick(self): from pyramid_sockjs import Session session = Session('id') session.send('message') self.now = self.now + timedelta(hours=1) session.get_transport_message() self.assertEqual(session.expires, self.now + session.timeout)
def test_get_transport_message_tick(self): from pyramid_sockjs import Session session = Session('id') session.manager = _SM() session.send('message') self.now = self.now + timedelta(hours=1) session.get_transport_message() self.assertEqual(session.expires, self.now + session.timeout)
def test_get_transport_message(self): from pyramid_sockjs import Session session = Session('id') session.send('message') self.assertEqual(session.get_transport_message(), 'message') from gevent.queue import Empty self.assertRaises( Empty, session.get_transport_message, timeout=0.1)
def test_get_transport_message(self): from pyramid_sockjs import Session session = Session('id') session.manager = _SM() session.send('message') self.assertEqual(session.get_transport_message(), 'message') from gevent.queue import Empty self.assertRaises(Empty, session.get_transport_message, timeout=0.1)