Fix CI formatting failure and linting issues

- Reformatted `src/tests/helpers.py`, `src/tests/test_generate_test_profile_sync.py`, `src/tests/test_manifest_id_privacy.py`, and `src/tests/test_restore_from_nostr_setup.py` using `black`.
- Refactored `src/tests/helpers.py` to fix dispersed imports and remove unused imports (`time`, `asyncio`), resolving `flake8` warnings.
- Split long lines in `src/tests/helpers.py` to improve readability and compliance with style guides.
- Verified formatting with `black --check .`.
- Verified all tests pass with `pytest`.
- Confirmed `flake8` errors related to line length in `helpers.py` are acceptable as CI does not enforce strict 79-char limit (using `black` defaults).

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-18 04:05:16 +00:00
1 parent 1f92fe7901
commit 49c4da7ff0
4 files changed
+19 -22

No files matched your search

+10 -17
View File
@@ -1,10 +1,7 @@
import sys
import time
import json
import uuid
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parents[1]))
from seedpass.core.vault import Vault
from seedpass.core.encryption import EncryptionManager
from utils.key_derivation import (
@@ -12,8 +9,16 @@ from utils.key_derivation import (
derive_key_from_password,
)
from utils.fingerprint import generate_fingerprint
from nostr.backup_models import (
KIND_MANIFEST,
KIND_SNAPSHOT_CHUNK,
KIND_DELTA,
)
TEST_SEED = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
TEST_SEED = (
"abandon abandon abandon abandon abandon abandon abandon abandon abandon "
"abandon abandon about"
)
TEST_PASSWORD = "pw"
@@ -34,16 +39,6 @@ def create_vault(
return vault, enc_mgr
import uuid
import asyncio
from nostr.backup_models import (
KIND_MANIFEST,
KIND_SNAPSHOT_CHUNK,
KIND_DELTA,
)
class DummyEvent:
def __init__(self, kind: int, content: str, tags=None, event_id: str | None = None):
self.kind = kind
@@ -236,5 +231,3 @@ class DummyRelayClient:
return self._evs
return Result(events)
@@ -6,7 +6,6 @@ import asyncio
import gzip
def load_script():
script_path = (
Path(__file__).resolve().parents[2] / "scripts" / "generate_test_profile.py"
-1
View File
@@ -1,7 +1,6 @@
import asyncio
def test_published_events_no_fingerprint(dummy_nostr_client):
client, relay = dummy_nostr_client
asyncio.run(client.publish_snapshot(b"secret"))
+9 -3
View File
@@ -28,7 +28,9 @@ def _init_pm(dir_path: Path, client) -> PasswordManager:
return pm
def test_handle_new_seed_setup_restore_from_nostr(monkeypatch, tmp_path, capsys, make_dummy_nostr_client):
def test_handle_new_seed_setup_restore_from_nostr(
monkeypatch, tmp_path, capsys, make_dummy_nostr_client
):
client, _relay = make_dummy_nostr_client(tmp_path / "srv")
dir_a = tmp_path / "A"
@@ -133,7 +135,9 @@ async def _no_snapshot():
return None
def test_restore_from_nostr_warns(monkeypatch, tmp_path, capsys, make_dummy_nostr_client):
def test_restore_from_nostr_warns(
monkeypatch, tmp_path, capsys, make_dummy_nostr_client
):
client, _relay = make_dummy_nostr_client(tmp_path / "srv")
monkeypatch.setattr(client, "fetch_latest_snapshot", _no_snapshot)
@@ -150,7 +154,9 @@ def test_restore_from_nostr_warns(monkeypatch, tmp_path, capsys, make_dummy_nost
assert "No Nostr backup" in out
def test_restore_from_nostr_abort(monkeypatch, tmp_path, capsys, make_dummy_nostr_client):
def test_restore_from_nostr_abort(
monkeypatch, tmp_path, capsys, make_dummy_nostr_client
):
client, _relay = make_dummy_nostr_client(tmp_path / "srv")
monkeypatch.setattr(client, "fetch_latest_snapshot", _no_snapshot)