Fix failing tests for legacy auth and heartbeat
- Add agent_id parameter to legacy Bearer auth test (required by design) - Add last_heartbeat to test_agent_with_secret fixture 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
42c682c579
commit
d72a0c125b
|
|
@ -9,7 +9,7 @@ import pytest
|
|||
import pytest_asyncio
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
|
||||
|
||||
from app.models.base import Base
|
||||
from app.models.base import Base, utc_now
|
||||
from app.models.tenant import Tenant
|
||||
from app.models.agent import Agent
|
||||
from app.models.registration_token import RegistrationToken
|
||||
|
|
@ -139,6 +139,7 @@ async def test_agent_with_secret(
|
|||
status="online",
|
||||
token="", # Empty for new auth scheme
|
||||
secret_hash=secret_hash,
|
||||
last_heartbeat=utc_now(),
|
||||
)
|
||||
db.add(agent)
|
||||
await db.commit()
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ class TestGetCurrentAgentCompat:
|
|||
x_agent_id=None,
|
||||
x_agent_secret=None,
|
||||
authorization=f"Bearer {test_agent_legacy.token}",
|
||||
agent_id=test_agent_legacy.id, # Legacy auth requires agent_id
|
||||
)
|
||||
|
||||
assert result.id == test_agent_legacy.id
|
||||
|
|
|
|||
Loading…
Reference in New Issue