-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define module-level fixtures for component tests
- Loading branch information
Showing
3 changed files
with
33 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from unittest import mock | ||
|
||
import pytest | ||
|
||
from kpops.component_handlers import ComponentHandlers | ||
from kpops.component_handlers.helm_wrapper.model import HelmDiffConfig | ||
from kpops.config import KpopsConfig, TopicNameConfig, set_config | ||
from tests.components import PIPELINE_BASE_DIR | ||
|
||
|
||
@pytest.fixture(autouse=True, scope="module") | ||
def config() -> None: | ||
config = KpopsConfig( | ||
topic_name_config=TopicNameConfig( | ||
default_error_topic_name="${component.type}-error-topic", | ||
default_output_topic_name="${component.type}-output-topic", | ||
), | ||
kafka_brokers="broker:9092", | ||
helm_diff_config=HelmDiffConfig(), | ||
pipeline_base_dir=PIPELINE_BASE_DIR, | ||
) | ||
set_config(config) | ||
|
||
|
||
@pytest.fixture(autouse=True, scope="module") | ||
def handlers() -> None: | ||
ComponentHandlers( | ||
schema_handler=mock.AsyncMock(), | ||
connector_handler=mock.AsyncMock(), | ||
topic_handler=mock.AsyncMock(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters