chore: fix all ruff lint errors + format — 0 errors, 306 tests pass
This commit is contained in:
+22
-14
@@ -7,16 +7,16 @@ import uuid
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
from sqlalchemy.ext.asyncio import AsyncEngine, async_sessionmaker, AsyncSession
|
||||
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession
|
||||
|
||||
from app.core.db import reset_engine_for_testing, close_engine
|
||||
from app.core.db import close_engine, reset_engine_for_testing
|
||||
from app.core.event_bus import get_event_bus
|
||||
from app.core.service_container import get_container
|
||||
from app.main import create_app
|
||||
from app.plugins.registry import reset_registry_for_testing
|
||||
from app.plugins.builtins.entity_links import EntityLinksPlugin
|
||||
from app.plugins.registry import reset_registry_for_testing
|
||||
from app.services.plugin_service import reset_plugin_service_for_testing
|
||||
from tests.conftest import seed_tenant_and_users, login_client, ORIGIN_HEADER
|
||||
from tests.conftest import ORIGIN_HEADER, login_client, seed_tenant_and_users
|
||||
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
@@ -240,14 +240,18 @@ async def test_event_cleanup_on_company_deleted(authed_client: AsyncClient):
|
||||
|
||||
# Publish company.deleted event
|
||||
event_bus = get_event_bus()
|
||||
await event_bus.publish("company.deleted", {
|
||||
"entity_id": str(company_id),
|
||||
"company_id": str(company_id),
|
||||
"tenant_id": str(tenant_id),
|
||||
})
|
||||
await event_bus.publish(
|
||||
"company.deleted",
|
||||
{
|
||||
"entity_id": str(company_id),
|
||||
"company_id": str(company_id),
|
||||
"tenant_id": str(tenant_id),
|
||||
},
|
||||
)
|
||||
|
||||
# Allow async event handler to complete
|
||||
import asyncio
|
||||
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
# Verify link is cleaned up
|
||||
@@ -279,14 +283,18 @@ async def test_event_cleanup_on_contact_deleted(authed_client: AsyncClient):
|
||||
|
||||
# Publish contact.deleted event
|
||||
event_bus = get_event_bus()
|
||||
await event_bus.publish("contact.deleted", {
|
||||
"entity_id": str(contact_id),
|
||||
"contact_id": str(contact_id),
|
||||
"tenant_id": str(tenant_id),
|
||||
})
|
||||
await event_bus.publish(
|
||||
"contact.deleted",
|
||||
{
|
||||
"entity_id": str(contact_id),
|
||||
"contact_id": str(contact_id),
|
||||
"tenant_id": str(tenant_id),
|
||||
},
|
||||
)
|
||||
|
||||
# Allow async event handler to complete
|
||||
import asyncio
|
||||
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
# Verify link is cleaned up
|
||||
|
||||
Reference in New Issue
Block a user