let Rpc client take a deltachat-rpc-server path and write a test using it

This commit is contained in:
holger krekel
2025-11-23 22:16:53 +01:00
parent 4188c2e4f5
commit 572cd51f1e
2 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
import subprocess
import sys
from deltachat_rpc_client import DeltaChat, Rpc
def test_install_venv_and_use_other_core(tmp_path):
venv = tmp_path.joinpath("venv1")
python = sys.executable
subprocess.check_call([python, "-m", "venv", venv])
subprocess.check_call([venv / "bin" / "pip", "install", "deltachat-rpc-server==2.20.0"])
rpc = Rpc(accounts_dir=tmp_path.joinpath("accounts"), rpc_server_path=venv.joinpath("bin", "deltachat-rpc-server"))
with rpc:
dc = DeltaChat(rpc)
assert dc.rpc.get_system_info()["deltachat_core_version"] == "v2.20.0"