From f1086584504d1d041297528c375219a7c8280cff Mon Sep 17 00:00:00 2001 From: Ramin Gharib Date: Thu, 27 Jun 2024 11:17:37 +0200 Subject: [PATCH] Update files --- .../components/streams_bootstrap/__init__.py | 2 - tests/components/test_streams_bootstrap.py | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/kpops/components/streams_bootstrap/__init__.py b/kpops/components/streams_bootstrap/__init__.py index f007d12c8..86c8276d0 100644 --- a/kpops/components/streams_bootstrap/__init__.py +++ b/kpops/components/streams_bootstrap/__init__.py @@ -32,8 +32,6 @@ class StreamsBootstrap(HelmApp, ABC): async def clean(self, dry_run: bool) -> None: await self.destroy(dry_run) - await super().clean(dry_run) async def reset(self, dry_run: bool) -> None: await self.destroy(dry_run) - await super().reset(dry_run) diff --git a/tests/components/test_streams_bootstrap.py b/tests/components/test_streams_bootstrap.py index a82fca8a9..78ef2d359 100644 --- a/tests/components/test_streams_bootstrap.py +++ b/tests/components/test_streams_bootstrap.py @@ -101,3 +101,61 @@ async def test_should_deploy_streams_bootstrap_app( }, HelmUpgradeInstallFlags(version="1.2.3"), ) + + @pytest.mark.asyncio() + async def test_should_call_destroy_when_reset_streams_bootstrap_app( + self, + config: KpopsConfig, + handlers: ComponentHandlers, + mocker: MockerFixture, + ): + streams_bootstrap = StreamsBootstrap( + name="example-name", + config=config, + handlers=handlers, + **{ + "namespace": "test-namespace", + "app": { + "streams": { + "outputTopic": "test", + "brokers": "fake-broker:9092", + }, + }, + "version": "1.2.3", + }, + ) + mock_destroy = mocker.patch.object(streams_bootstrap, "destroy") + + dry_run = True + await streams_bootstrap.reset(dry_run) + + mock_destroy.assert_called_once_with(dry_run) + + @pytest.mark.asyncio() + async def test_should_call_destroy_when_clean_streams_bootstrap_app( + self, + config: KpopsConfig, + handlers: ComponentHandlers, + mocker: MockerFixture, + ): + streams_bootstrap = StreamsBootstrap( + name="example-name", + config=config, + handlers=handlers, + **{ + "namespace": "test-namespace", + "app": { + "streams": { + "outputTopic": "test", + "brokers": "fake-broker:9092", + }, + }, + "version": "1.2.3", + }, + ) + mock_destroy = mocker.patch.object(streams_bootstrap, "destroy") + + dry_run = True + await streams_bootstrap.clean(dry_run) + + mock_destroy.assert_called_once_with(dry_run)