diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-19 17:58:05 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-19 17:58:05 +0200 |
| commit | 1ec316035ce9aa656dd18a05889856bce9e3aba3 (patch) | |
| tree | b50e97f50d485ef2a88ce36fe4d7511d9fe3e288 /packages/meshbay-node/tests/test_indexer.py | |
| parent | 171a3e175889ce30f201fcdf5c4632f480344ae6 (diff) | |
| parent | 95dd3dc13aecec85c2fd72410cd4d1f4ed582dfa (diff) | |
| download | meshbay-1ec316035ce9aa656dd18a05889856bce9e3aba3.tar.gz | |
Merge origin/main: the tree-wide ruff pass beside the Music reconnect work
Diffstat (limited to 'packages/meshbay-node/tests/test_indexer.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_indexer.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/meshbay-node/tests/test_indexer.py b/packages/meshbay-node/tests/test_indexer.py index 6aee1b5..e97e2ef 100644 --- a/packages/meshbay-node/tests/test_indexer.py +++ b/packages/meshbay-node/tests/test_indexer.py @@ -4,16 +4,15 @@ import asyncio import os import threading import time -import pytest from pathlib import Path -from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey -from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey +import meshbay_node.indexer.indexer as indexer_mod +import pytest +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey from meshbay_common.crypto import generate_gek from meshbay_node.indexer import DirectoryIndexer, GroupIndex, IndexCache -import meshbay_node.indexer.indexer as indexer_mod + from conftest import one_root -from meshbay_node.keystore import NodeKeys @pytest.fixture @@ -397,7 +396,8 @@ async def test_scan_interrupted_partway_leaves_only_completed_files_cached( indexer_mod._scan_file = real_scan_file assert resumed.index.count == 5 - assert len(calls) == 2, f"expected only the 2 not-yet-cached files to be hashed, got {len(calls)}" + assert len(calls) == 2, ( + f"expected only the 2 not-yet-cached files to be hashed, got {len(calls)}") # ── Progress state ─────────────────────────────────────────────────────────── @@ -741,7 +741,7 @@ def test_small_file_gets_hash_version_1(tmp_path): def test_large_file_gets_hash_version_2(tmp_path): - from meshbay_node.indexer.indexer import _scan_file, _PARTIAL_THRESHOLD + from meshbay_node.indexer.indexer import _PARTIAL_THRESHOLD, _scan_file d = tmp_path / "root" d.mkdir() f = d / "big.mkv" @@ -755,7 +755,7 @@ def test_large_file_gets_hash_version_2(tmp_path): def test_file_at_threshold_gets_hash_version_1(tmp_path): - from meshbay_node.indexer.indexer import _scan_file, _PARTIAL_THRESHOLD + from meshbay_node.indexer.indexer import _PARTIAL_THRESHOLD, _scan_file d = tmp_path / "root" d.mkdir() f = d / "exact.mkv" @@ -770,7 +770,7 @@ def test_partial_hash_differs_from_full_hash(tmp_path): """For a file above the threshold, the partial hash must differ from what a full-file blake3 would produce (they read different bytes).""" import blake3 as b3 - from meshbay_node.indexer.indexer import _scan_file, _PARTIAL_THRESHOLD + from meshbay_node.indexer.indexer import _PARTIAL_THRESHOLD, _scan_file d = tmp_path / "root" d.mkdir() f = d / "big.mkv" @@ -785,7 +785,7 @@ def test_partial_hash_differs_from_full_hash(tmp_path): def test_partial_hash_is_deterministic(tmp_path): - from meshbay_node.indexer.indexer import _scan_file, _PARTIAL_THRESHOLD + from meshbay_node.indexer.indexer import _PARTIAL_THRESHOLD, _scan_file d = tmp_path / "root" d.mkdir() f = d / "big.mkv" |