コード例 #1
0
 def test_bad_proto(self) -> None:
     with pytest.raises(ValueError):
         bcu.server_url_for_websocket_url("junk://foo.com/ws")
コード例 #2
0
 def test_bad_ending(self) -> None:
     with pytest.raises(ValueError):
         bcu.server_url_for_websocket_url("ws://foo.com/junk")
     with pytest.raises(ValueError):
         bcu.server_url_for_websocket_url("wss://foo.com/junk")
コード例 #3
0
 def test_with_wss(self) -> None:
     assert bcu.server_url_for_websocket_url("wss://foo.com/ws") == "https://foo.com/"
コード例 #4
0
ファイル: test_util.py プロジェクト: alamont/bokeh
 def test_bad_ending(self):
     with pytest.raises(ValueError):
         bcu.server_url_for_websocket_url("ws://foo.com/junk")
     with pytest.raises(ValueError):
         bcu.server_url_for_websocket_url("wss://foo.com/junk")
コード例 #5
0
ファイル: test_util.py プロジェクト: alamont/bokeh
 def test_bad_proto(self):
     with pytest.raises(ValueError):
         bcu.server_url_for_websocket_url("junk://foo.com/ws")
コード例 #6
0
ファイル: test_util.py プロジェクト: alamont/bokeh
 def test_with_wss(self):
     assert bcu.server_url_for_websocket_url("wss://foo.com/ws") == "https://foo.com/"
コード例 #7
0
def test_server_url_for_websocket_url_with_ws():
    assert bcu.server_url_for_websocket_url(
        "ws://foo.com/ws") == "http://foo.com/"