mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-10 11:13:08 +00:00
fix linting errors
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import os
|
||||
import httpx
|
||||
import asyncio
|
||||
import time
|
||||
|
||||
@@ -7,7 +6,6 @@ from sixty_nuts import Wallet
|
||||
from sqlmodel import select, func, col
|
||||
from .db import ApiKey, AsyncSession, get_session
|
||||
|
||||
from .db import ApiKey, AsyncSession
|
||||
|
||||
RECEIVE_LN_ADDRESS = os.environ["RECEIVE_LN_ADDRESS"]
|
||||
MINT = os.environ.get("MINT", "https://mint.minibits.cash/Bitcoin")
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ async def query_nostr_relay_with_search(
|
||||
"limit": limit,
|
||||
"#p": [npub], # Posts that tag this pubkey
|
||||
}
|
||||
except:
|
||||
except Exception:
|
||||
# If conversion fails, try regular search
|
||||
filter_obj = {
|
||||
"kinds": kinds,
|
||||
|
||||
@@ -149,7 +149,6 @@ async def proxy(
|
||||
async def stream_with_cost():
|
||||
# Store all chunks to analyze
|
||||
stored_chunks = []
|
||||
usage_data_found = False
|
||||
|
||||
async for chunk in response.aiter_bytes():
|
||||
# Store chunk for later analysis
|
||||
@@ -190,7 +189,6 @@ async def proxy(
|
||||
# Format as SSE and yield
|
||||
cost_json = json.dumps({"cost": cost_data})
|
||||
yield f"data: {cost_json}\n\n".encode()
|
||||
usage_data_found = True
|
||||
break
|
||||
except json.JSONDecodeError:
|
||||
continue
|
||||
|
||||
@@ -57,7 +57,6 @@ with patch("sixty_nuts.Wallet") as mock_wallet_class:
|
||||
|
||||
from router.main import app
|
||||
from router.db import get_session
|
||||
from router.models import MODELS
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
||||
@@ -2,7 +2,7 @@ import pytest
|
||||
import pytest_asyncio
|
||||
import hashlib
|
||||
import uuid
|
||||
from unittest.mock import patch, AsyncMock, MagicMock
|
||||
from unittest.mock import patch, AsyncMock
|
||||
from httpx import AsyncClient
|
||||
from router.db import ApiKey, AsyncSession
|
||||
|
||||
@@ -184,7 +184,6 @@ async def test_account_with_cashu_token(
|
||||
):
|
||||
"""Test authentication with a cashu token creates a new account."""
|
||||
cashu_token = "cashuBqQSEQ123456"
|
||||
hashed = hash_api_key(cashu_token)
|
||||
|
||||
async def mock_credit_balance(
|
||||
token: str, key: ApiKey, session: AsyncSession
|
||||
@@ -200,7 +199,7 @@ async def test_account_with_cashu_token(
|
||||
"router.cashu.credit_balance",
|
||||
new_callable=AsyncMock,
|
||||
side_effect=mock_credit_balance,
|
||||
) as mock_credit:
|
||||
):
|
||||
response = await async_client.get(
|
||||
"/v1/wallet/", headers={"Authorization": f"Bearer {cashu_token}"}
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
import asyncio
|
||||
from unittest.mock import patch, AsyncMock, MagicMock
|
||||
from unittest.mock import patch, AsyncMock
|
||||
from router.models import Model, Architecture, Pricing, TopProvider, update_sats_pricing, MODELS
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import json
|
||||
import os
|
||||
import uuid
|
||||
from unittest.mock import AsyncMock, patch
|
||||
from httpx import AsyncClient, Response as HttpxResponse
|
||||
from httpx import AsyncClient
|
||||
from router.db import ApiKey, AsyncSession
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user