Exemple #1
0
 def test_bad_proto(self) -> None:
     with pytest.raises(ValueError):
         bcu.websocket_url_for_server_url("junk://foo.com")
Exemple #2
0
 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"
Exemple #3
0
 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"
Exemple #5
0
 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"