mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
20 lines
641 B
Python
20 lines
641 B
Python
import pytest
|
|
from arroyo.processing.strategies.abstract import ProcessingStrategyFactory
|
|
|
|
from sentry import consumers
|
|
from sentry.conf.types.consumer_definition import ConsumerDefinition
|
|
from sentry.utils.imports import import_string
|
|
|
|
|
|
@pytest.mark.parametrize("consumer_def", list(consumers.KAFKA_CONSUMERS.items()))
|
|
def test_all_importable(consumer_def, settings):
|
|
name: str
|
|
defn: ConsumerDefinition
|
|
name, defn = consumer_def
|
|
|
|
factory = import_string(defn["strategy_factory"])
|
|
assert issubclass(factory, ProcessingStrategyFactory)
|
|
|
|
topic = defn["topic"]
|
|
assert topic is None or topic in settings.KAFKA_TOPICS
|