Complete project rebrand for better positioning in the press freedom and digital security space. FieldWitness communicates both field deployment and evidence testimony — appropriate for the target audience of journalists, NGOs, and human rights organizations. Rename mapping: - soosef → fieldwitness (package, CLI, all imports) - soosef.stegasoo → fieldwitness.stego - soosef.verisoo → fieldwitness.attest - ~/.soosef/ → ~/.fwmetadata/ (innocuous data dir name) - SOOSEF_DATA_DIR → FIELDWITNESS_DATA_DIR - SoosefConfig → FieldWitnessConfig - SoosefError → FieldWitnessError Also includes: - License switch from MIT to GPL-3.0 - C2PA bridge module (Phase 0-2 MVP): cert.py, export.py, vendor_assertions.py - README repositioned to lead with provenance/federation, stego backgrounded - Threat model skeleton at docs/security/threat-model.md - Planning docs: docs/planning/c2pa-integration.md, docs/planning/gtm-feasibility.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
"""Shared test fixtures for FieldWitness tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
|
|
|
|
|
|
@pytest.fixture()
|
|
def tmp_fieldwitness_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
|
|
"""Set FIELDWITNESS_DATA_DIR to a temporary directory.
|
|
|
|
This must be used before importing any module that reads fieldwitness.paths
|
|
at import time. For modules that read paths lazily (most of them),
|
|
monkeypatching the paths module directly is more reliable.
|
|
"""
|
|
data_dir = tmp_path / ".fieldwitness"
|
|
data_dir.mkdir()
|
|
monkeypatch.setenv("FIELDWITNESS_DATA_DIR", str(data_dir))
|
|
return data_dir
|
|
|
|
|
|
@pytest.fixture()
|
|
def chain_dir(tmp_path: Path) -> Path:
|
|
"""A temporary chain directory."""
|
|
d = tmp_path / "chain"
|
|
d.mkdir()
|
|
return d
|
|
|
|
|
|
@pytest.fixture()
|
|
def private_key() -> Ed25519PrivateKey:
|
|
"""A fresh Ed25519 private key for testing."""
|
|
return Ed25519PrivateKey.generate()
|