Skip to content

Commit

Permalink
Test classifying an LTD Technote, sqr-075
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed Sep 22, 2023
1 parent 387e689 commit dc0d05f
Show file tree
Hide file tree
Showing 4 changed files with 970 additions and 0 deletions.
2 changes: 2 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def _make_env_vars() -> dict[str, str]:
"OOK_ENABLE_CONSUMER": "false",
"ALGOLIA_APP_ID": "test",
"ALGOLIA_API_KEY": "test",
"OOK_GITHUB_APP_ID": "1234",
"OOK_GITHUB_APP_PRIVATE_KEY": "test",
}


Expand Down
15 changes: 15 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@

import pytest
import pytest_asyncio
import structlog
from asgi_lifespan import LifespanManager
from fastapi import FastAPI
from httpx import AsyncClient

from ook import main
from ook.factory import Factory

from .support.algoliasearch import MockSearchClient, patch_algoliasearch
from .support.kafkaproducer import patch_aiokafkaproducer
Expand Down Expand Up @@ -65,3 +67,16 @@ async def client(app: FastAPI) -> AsyncIterator[AsyncClient]:
"""Return an ``httpx.AsyncClient`` configured to talk to the test app."""
async with AsyncClient(app=app, base_url="https://example.com/") as client:
yield client


@pytest_asyncio.fixture
async def factory(
mock_kafka_producer: Mock,
mock_schema_manager: MockPydanticSchemaManager,
mock_algoliasearch: MockSearchClient,
) -> AsyncIterator[Factory]:
"""Return a configured ``Factory``."""
logger = structlog.get_logger("ook")
async with Factory.create_standalone(logger=logger) as factory:
yield factory
await factory.aclose()
Loading

0 comments on commit dc0d05f

Please sign in to comment.