Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add better error handling for invalid client URLs (#388)
* add better error handling for invalid client URLs
- Loading branch information
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Test the json_rpc_client.""" | ||
from __future__ import annotations | ||
|
||
from unittest import TestCase | ||
|
||
from xrpl.asyncio.clients.exceptions import XRPLRequestFailureException | ||
from xrpl.clients import JsonRpcClient | ||
from xrpl.models.requests import ServerInfo | ||
|
||
|
||
class TestJsonRpcClient(TestCase): | ||
"""Test json_rpc_client.""" | ||
|
||
def test_json_rpc_client_invalid_url(self: TestJsonRpcClient) -> None: | ||
# Invalid URL | ||
JSON_RPC_URL = "https://s2.ripple.com:51233/" | ||
with self.assertRaises(XRPLRequestFailureException): | ||
client = JsonRpcClient(JSON_RPC_URL) | ||
client.request(ServerInfo()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters