예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)