-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import confluent_kafka | ||
from click.testing import CliRunner | ||
|
||
from esque import config | ||
from esque.cli.commands import ping | ||
from esque.topic_controller import TopicController | ||
|
||
|
||
def test_smoke_test_ping(cli_runner: CliRunner): | ||
result = cli_runner.invoke(ping) | ||
|
||
assert result.exit_code == 0 | ||
|
||
|
||
def test_correct_amount_of_messages( | ||
mocker, cli_runner: CliRunner, confluent_admin_client: confluent_kafka.admin.AdminClient, topic_id: str | ||
): | ||
config.RANDOM = "test" | ||
|
||
topic_controller_delete_topic = mocker.patch.object(TopicController, "delete_topic", mocker.Mock()) | ||
|
||
result = cli_runner.invoke(ping) | ||
|
||
assert result.exit_code == 0 | ||
assert topic_controller_delete_topic.call_count == 1 |