def test_bad_proto(self) -> None: with pytest.raises(ValueError): bcu.websocket_url_for_server_url("junk://foo.com")
def test_with_https(self) -> None: assert bcu.websocket_url_for_server_url("https://foo.com") == "wss://foo.com/ws" assert bcu.websocket_url_for_server_url("https://foo.com/") == "wss://foo.com/ws"
def test_bad_proto(self): with pytest.raises(ValueError): bcu.websocket_url_for_server_url("junk://foo.com")
def test_with_http(self): assert bcu.websocket_url_for_server_url( "http://foo.com") == "ws://foo.com/ws" assert bcu.websocket_url_for_server_url( "http://foo.com/") == "ws://foo.com/ws"
def test_with_https(self): assert bcu.websocket_url_for_server_url("https://foo.com") == "wss://foo.com/ws" assert bcu.websocket_url_for_server_url("https://foo.com/") == "wss://foo.com/ws"