Skip to content

Commit

Permalink
test(jsonrpc): test get_provider_info
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Oct 27, 2023
1 parent 97176b1 commit 2f5c6b5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions deltachat-rpc-client/tests/test_something.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,22 @@ def test_openrpc_command_line() -> None:
openrpc = json.loads(out)
assert "openrpc" in openrpc
assert "methods" in openrpc


def test_provider_info(rpc) -> None:
account_id = rpc.add_account()

provider_info = rpc.get_provider_info(account_id, "example.org")
assert provider_info["id"] == "example.com"

provider_info = rpc.get_provider_info(account_id, "uep7oiw4ahtaizuloith.org")
assert provider_info is None

# Test MX record resolution.
provider_info = rpc.get_provider_info(account_id, "github.com")
assert provider_info["id"] == "gmail"

# Disable MX record resolution.
rpc.set_config(account_id, "socks5_enabled", "1")
provider_info = rpc.get_provider_info(account_id, "github.com")
assert provider_info is None

0 comments on commit 2f5c6b5

Please sign in to comment.