summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_indexer.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/test_indexer.py')
-rw-r--r--packages/meshbay-node/tests/test_indexer.py20
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"