def test_init(self): ac = bsc.ApplicationContext("app", io_loop="ioloop") sc = bsc.BokehServerContext(ac) c = bsc.BokehSessionContext("id", sc, "doc") assert c.session is None assert c.request is None assert not c.destroyed
def test_logout_url(self): ac = bsc.ApplicationContext("app", io_loop="ioloop") sc = bsc.BokehServerContext(ac) c = bsc.BokehSessionContext("id", sc, "doc", logout_url="/logout") assert c.session is None assert c.request is None assert not c.destroyed assert c.logout_url == "/logout"
def test_destroyed(self): class FakeSession(object): destroyed = False ac = bsc.ApplicationContext("app", io_loop="ioloop") sc = bsc.BokehServerContext(ac) c = bsc.BokehSessionContext("id", sc, "doc") sess = FakeSession() c._session = sess assert not c.destroyed sess.destroyed = True assert c.destroyed