コード例 #1
0
 def test_check_origin(self):
     ac = ActiveConnections()
     app = tornado.web.Application()
     app.active_connections = ac
     r = MockRequest()
     wh = WSHandler(app, r)
     assert wh.check_origin(None)
     assert wh.check_origin(False)
コード例 #2
0
 def test_check_origin(self):
     ac = ActiveConnections()
     app = tornado.web.Application()
     app.active_connections = ac
     r = MockRequest()
     wh = WSHandler(app, r)
     assert wh.check_origin(None)
     assert wh.check_origin(False)
コード例 #3
0
    def test_open_connection(self):
        ac = ActiveConnections()
        app = tornado.web.Application()
        app.active_connections = ac
        r = MockRequest()
        wh = WSHandler(app, r)

        wh.open()

        assert wh in ac.connections
コード例 #4
0
    def test_open_connection(self):
        ac = ActiveConnections()
        app = tornado.web.Application()
        app.active_connections = ac
        r = MockRequest()
        wh = WSHandler(app, r)

        wh.open()

        assert wh in ac.connections
コード例 #5
0
    def test_con_close(self):
        ac = ActiveConnections()
        app = tornado.web.Application()
        app.active_connections = ac
        r = MockRequest()
        wh = WSHandler(app, r)
        ac.connections.append(wh)

        wh.on_close()

        assert wh not in ac.connections
コード例 #6
0
    def test_con_close(self):
        ac = ActiveConnections()
        app = tornado.web.Application()
        app.active_connections = ac
        r = MockRequest()
        wh = WSHandler(app, r)
        ac.connections.append(wh)

        wh.on_close()

        assert wh not in ac.connections