示例#1
0
    def test_creation(self):
        c = bcc.ClientConnection("session", "wsurl")
        assert c.url == "wsurl"
        assert c.connected == False
        assert isinstance(c.io_loop, IOLoop)

        assert c._session == "session"
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate == None
        assert c._server_info == None
示例#2
0
    def test_creation_with_arguments(self) -> None:
        c = bcc.ClientConnection("session", "wsurl", arguments=dict(foo="bar"))
        assert c.url == "wsurl"
        assert c.connected == False
        assert isinstance(c.io_loop, IOLoop)

        assert c._session == "session"
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments == dict(foo="bar")
示例#3
0
 def test__versioned_url_with_arguments(self):
     c = bcc.ClientConnection(FakeSess(),
                              "wsurl",
                              arguments=dict(foo="bar"))
     assert c._versioned_url(
     ) == "wsurl?bokeh-protocol-version=1.0&bokeh-session-id=session_id&foo=bar"
示例#4
0
 def test__versioned_url(self):
     c = bcc.ClientConnection(FakeSess(), "wsurl")
     assert c._versioned_url(
     ) == "wsurl?bokeh-protocol-version=1.0&bokeh-session-id=session_id"
示例#5
0
 def test__formatted_url_with_arguments(self):
     c = bcc.ClientConnection(FakeSess(),
                              "wsurl",
                              arguments=dict(foo="bar"))
     assert c._formatted_url(
     ) == "wsurl?bokeh-session-id=session_id&foo=bar"
示例#6
0
 def test__formatted_url(self):
     c = bcc.ClientConnection(FakeSess(), "wsurl")
     assert c._formatted_url() == "wsurl?bokeh-session-id=session_id"