Example #1
0
 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
Example #2
0
 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"
Example #3
0
 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
Example #4
0
 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])
Example #5
0
 def test_init(self):
     ac = bsc.ApplicationContext("app", io_loop="ioloop")
     c = bsc.BokehServerContext(ac)
     assert c.application_context == ac
Example #6
0
 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