Skip to content

Commit

Permalink
Revert deletion of test_delete_topic
Browse files Browse the repository at this point in the history
  • Loading branch information
shahar1 committed Jun 8, 2024
1 parent b0ad3e8 commit cbbf003
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/providers/apache/kafka/hooks/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,12 @@ def test_create_topic_warning(self, admin_client, caplog):
self.hook.create_topic(topics=[("topic_name", 0, 1)])
assert "The topic topic_name already exists" in caplog.text

@patch(
"airflow.providers.apache.kafka.hooks.client.AdminClient",
)
def test_delete_topic(self, admin_client):
mock_f = MagicMock()
admin_client.return_value.delete_topics.return_value = {"topic_name": mock_f}
self.hook.delete_topic(topics=["topic_name"])
admin_client.return_value.delete_topics.assert_called_with(["topic_name"])
mock_f.result.assert_called_once()

0 comments on commit cbbf003

Please sign in to comment.