def test_bad_proto(self) -> None: with pytest.raises(ValueError): bcu.server_url_for_websocket_url("junk://foo.com/ws")
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")
def test_with_wss(self) -> None: assert bcu.server_url_for_websocket_url("wss://foo.com/ws") == "https://foo.com/"
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")
def test_bad_proto(self): with pytest.raises(ValueError): bcu.server_url_for_websocket_url("junk://foo.com/ws")
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/"