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
def test_sessions(self): ac = bsc.ApplicationContext("app", io_loop="ioloop") ac._sessions = dict(foo=1, bar=2) c = bsc.BokehServerContext(ac) assert set(c.sessions) == set([1,2])
def test_init(self): ac = bsc.ApplicationContext("app", io_loop="ioloop") c = bsc.BokehServerContext(ac) assert c.application_context == ac
def test_init(self) -> None: ac = bsc.ApplicationContext("app", io_loop="ioloop") c = bsc.BokehServerContext(ac) assert c.application_context == ac assert len(gc.get_referrers(ac)) == 0