diff --git a/deltachat-rpc-client/tests/test_something.py b/deltachat-rpc-client/tests/test_something.py index f91f9844e..548b7777c 100644 --- a/deltachat-rpc-client/tests/test_something.py +++ b/deltachat-rpc-client/tests/test_something.py @@ -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