Пример #1
0
 def test_bad_proto(self) -> None:
     with pytest.raises(ValueError):
         bcu.websocket_url_for_server_url("junk://foo.com")
Пример #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"
Пример #3
0
 def test_bad_proto(self):
     with pytest.raises(ValueError):
         bcu.websocket_url_for_server_url("junk://foo.com")
Пример #4
0
 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"
Пример #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"