Ejemplo n.º 1
0
 def test_bad_proto(self) -> None:
     with pytest.raises(ValueError):
         bcu.server_url_for_websocket_url("junk://foo.com/ws")
Ejemplo n.º 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")
Ejemplo n.º 3
0
 def test_with_wss(self) -> None:
     assert bcu.server_url_for_websocket_url("wss://foo.com/ws") == "https://foo.com/"
Ejemplo n.º 4
0
 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")
Ejemplo n.º 5
0
 def test_bad_proto(self):
     with pytest.raises(ValueError):
         bcu.server_url_for_websocket_url("junk://foo.com/ws")
Ejemplo n.º 6
0
 def test_with_wss(self):
     assert bcu.server_url_for_websocket_url("wss://foo.com/ws") == "https://foo.com/"
def test_server_url_for_websocket_url_with_ws():
    assert bcu.server_url_for_websocket_url(
        "ws://foo.com/ws") == "http://foo.com/"