From 04d6903369e1e346fcd045faba2b2a65e0855eac Mon Sep 17 00:00:00 2001 From: 9qeklajc Date: Sun, 25 Jan 2026 14:31:55 +0100 Subject: [PATCH] lint & fmt --- routstr/balance.py | 2 +- tests/integration/test_child_keys.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/routstr/balance.py b/routstr/balance.py index a7c2e467..dee5ad2f 100644 --- a/routstr/balance.py +++ b/routstr/balance.py @@ -3,7 +3,7 @@ import hashlib from time import monotonic from typing import Annotated, NoReturn -from fastapi import APIRouter, Body, Depends, Header, HTTPException +from fastapi import APIRouter, Depends, Header, HTTPException from pydantic import BaseModel from .auth import validate_bearer_key diff --git a/tests/integration/test_child_keys.py b/tests/integration/test_child_keys.py index e868d1cb..64e92e0d 100644 --- a/tests/integration/test_child_keys.py +++ b/tests/integration/test_child_keys.py @@ -6,7 +6,7 @@ from fastapi import HTTPException from sqlmodel.ext.asyncio.session import AsyncSession from routstr.auth import adjust_payment_for_tokens, pay_for_request -from routstr.balance import create_child_key +from routstr.balance import ChildKeyRequest, create_child_key from routstr.core.db import ApiKey from routstr.core.settings import settings @@ -27,7 +27,9 @@ async def test_child_key_flow(integration_session: AsyncSession) -> None: settings.child_key_cost = 1000 # 1 sat # 2. Call create_child_key - result = await create_child_key(parent_key, integration_session) + result = await create_child_key( + ChildKeyRequest(count=1), parent_key, integration_session + ) assert "api_key" in result assert result["cost_msats"] == 1000 @@ -111,7 +113,9 @@ async def test_child_key_insufficient_balance( settings.child_key_cost = 1000 with pytest.raises(HTTPException) as exc: - await create_child_key(parent_key, integration_session) + await create_child_key( + ChildKeyRequest(count=1), parent_key, integration_session + ) assert exc.value.status_code == 402 @@ -132,6 +136,6 @@ async def test_child_key_cannot_create_child(integration_session: AsyncSession) await integration_session.refresh(child_key) with pytest.raises(HTTPException) as exc: - await create_child_key(child_key, integration_session) + await create_child_key(ChildKeyRequest(count=1), child_key, integration_session) assert exc.value.status_code == 400 assert "Cannot create a child key for another child key" in str(exc.value.detail)