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