Reorganize for great victory and move to blob for payload hasg

This commit is contained in:
Jack Kingsman
2026-02-27 21:03:34 -08:00
parent fc27361e37
commit ce99d63701
27 changed files with 2028 additions and 2303 deletions
-29
View File
@@ -8,10 +8,8 @@ import hashlib
import time
from unittest.mock import AsyncMock, MagicMock, patch
import httpx
import pytest
from app.database import Database
from app.radio import radio_manager
from app.repository import (
ChannelRepository,
@@ -31,33 +29,6 @@ def _reset_radio_state():
radio_manager._operation_lock = prev_lock
@pytest.fixture
async def test_db():
"""Create an in-memory test database with schema + migrations."""
import app.repository as repo_module
db = Database(":memory:")
await db.connect()
original_db = repo_module.db
repo_module.db = db
try:
yield db
finally:
repo_module.db = original_db
await db.disconnect()
@pytest.fixture
def client():
"""Create an httpx AsyncClient for testing the app."""
from app.main import app
transport = httpx.ASGITransport(app=app)
return httpx.AsyncClient(transport=transport, base_url="http://test")
async def _insert_contact(public_key, name="Alice", **overrides):
"""Insert a contact into the test database."""
data = {