From 7a6ae64595829126d3585cce517f17dbf85f2694 Mon Sep 17 00:00:00 2001 From: Salomon Popp Date: Wed, 3 Jul 2024 11:56:46 +0200 Subject: [PATCH] Rename functions --- kpops/api/__init__.py | 8 ++++---- tests/api/test_handlers.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kpops/api/__init__.py b/kpops/api/__init__.py index 79fe0ccd8..3073d9452 100644 --- a/kpops/api/__init__.py +++ b/kpops/api/__init__.py @@ -54,7 +54,7 @@ def generate( environment, verbose, ) - pipeline = create_pipeline(pipeline_path, kpops_config, environment) + pipeline = _create_pipeline(pipeline_path, kpops_config, environment) log.info(f"Picked up pipeline '{pipeline_path.parent.name}'") if steps: component_names = steps @@ -320,7 +320,7 @@ def init( init_project(path, config_include_opt) -def create_pipeline( +def _create_pipeline( pipeline_path: Path, kpops_config: KpopsConfig, environment: str | None, @@ -337,12 +337,12 @@ def create_pipeline( registry.find_components(kpops_config.components_module) registry.find_components("kpops.components") - handlers = setup_handlers(kpops_config) + handlers = _setup_handlers(kpops_config) parser = PipelineGenerator(kpops_config, registry, handlers) return parser.load_yaml(pipeline_path, environment) -def setup_handlers(config: KpopsConfig) -> ComponentHandlers: +def _setup_handlers(config: KpopsConfig) -> ComponentHandlers: """Set up handlers for a component. :param config: KPOps config. diff --git a/tests/api/test_handlers.py b/tests/api/test_handlers.py index 18d35131b..c3a92784d 100644 --- a/tests/api/test_handlers.py +++ b/tests/api/test_handlers.py @@ -1,6 +1,6 @@ from pytest_mock import MockerFixture -from kpops.api import setup_handlers +from kpops.api import _setup_handlers from kpops.component_handlers import ComponentHandlers from kpops.component_handlers.kafka_connect.kafka_connect_handler import ( KafkaConnectHandler, @@ -35,7 +35,7 @@ def test_set_up_handlers_with_no_schema_handler(mocker: MockerFixture): topic_handler=topic_handler, ) - actual_handlers = setup_handlers(config) + actual_handlers = _setup_handlers(config) connector_handler_mock.from_kpops_config.assert_called_once_with(config) @@ -72,7 +72,7 @@ def test_set_up_handlers_with_schema_handler(mocker: MockerFixture): topic_handler=topic_handler, ) - actual_handlers = setup_handlers(config) + actual_handlers = _setup_handlers(config) schema_handler_mock.load_schema_handler.assert_called_once_with(config)