simplex-chat: sync nodejs and python libs with 7.0.0-beta.3 types (#7219)

This commit is contained in:
sh
2026-07-08 12:01:17 +04:00
committed by GitHub
parent 8b537fbc3a
commit a4e3a1ea11
4 changed files with 12 additions and 10 deletions
@@ -4,6 +4,7 @@ from pathlib import Path
import pytest
from simplex_chat._native import _cache_root, _resolve_libs_dir, _download
from simplex_chat._version import LIBS_VERSION
def test_cache_root_linux(tmp_path, monkeypatch):
@@ -41,7 +42,7 @@ def test_resolve_downloads_when_missing(tmp_path, monkeypatch):
monkeypatch.setattr("simplex_chat._native._download", fake_download)
libs_dir = _resolve_libs_dir("sqlite")
assert libs_dir == tmp_path / "simplex-chat" / "v6.5.2" / "sqlite"
assert libs_dir == tmp_path / "simplex-chat" / f"v{LIBS_VERSION}" / "sqlite"
assert called["backend"] == "sqlite"
assert (libs_dir / "libsimplex.so").exists()
@@ -49,7 +50,7 @@ def test_resolve_downloads_when_missing(tmp_path, monkeypatch):
def test_resolve_uses_cache_on_second_call(tmp_path, monkeypatch):
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path))
monkeypatch.setattr("sys.platform", "linux")
cached = tmp_path / "simplex-chat" / "v6.5.2" / "sqlite"
cached = tmp_path / "simplex-chat" / f"v{LIBS_VERSION}" / "sqlite"
cached.mkdir(parents=True)
(cached / "libsimplex.so").touch()
# Should NOT call _download — use the cached file.
@@ -1,6 +1,7 @@
from unittest.mock import patch
import pytest
from simplex_chat._native import _platform_tag, _libs_url, _libname
from simplex_chat._version import LIBS_VERSION
@patch("sys.platform", "linux")
@@ -42,7 +43,7 @@ def test_url_sqlite(_):
assert (
_libs_url("sqlite")
== "https://github.com/simplex-chat/simplex-chat-libs/releases/download/"
"v6.5.2/simplex-chat-libs-linux-x86_64.zip"
f"v{LIBS_VERSION}/simplex-chat-libs-linux-x86_64.zip"
)
@@ -51,5 +52,5 @@ def test_url_postgres(_):
assert (
_libs_url("postgres")
== "https://github.com/simplex-chat/simplex-chat-libs/releases/download/"
"v6.5.2/simplex-chat-libs-linux-x86_64-postgres.zip"
f"v{LIBS_VERSION}/simplex-chat-libs-linux-x86_64-postgres.zip"
)