Skip to content

Commit

Permalink
Update files
Browse files Browse the repository at this point in the history
  • Loading branch information
raminqaf committed Jun 27, 2024
1 parent ca52f36 commit f108658
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
2 changes: 0 additions & 2 deletions kpops/components/streams_bootstrap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
58 changes: 58 additions & 0 deletions tests/components/test_streams_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit f108658

Please sign in to comment.