Skip to content

Commit

Permalink
adding more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
diegorubin committed Jun 21, 2021
1 parent 20d0975 commit 13bcb40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Lifeguard RabbitMQ Plugin
"""
from setuptools import find_packages, setup

setup(
Expand Down
7 changes: 6 additions & 1 deletion tests/test_validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ def test_consumers_running_validation_when_problem(self, mock_count_consumers):

@patch("lifeguard_rabbitmq.validations.count_consumers")
@patch("lifeguard_rabbitmq.validations.logger")
@patch("lifeguard_rabbitmq.validations.traceback")
def test_consumers_running_validation_when_problem_because_integration_error(
self, mock_logger, mock_count_consumers
self, mock_traceback, mock_logger, mock_count_consumers
):
mock_traceback.format_exc.return_value = "traceback"
mock_count_consumers.side_effect = [Exception("error")]

response = consumers_running_validation()
Expand All @@ -121,6 +123,9 @@ def test_consumers_running_validation_when_problem_because_integration_error(
]
},
)
mock_logger.error.assert_called_with(
"error on recover queue infos %s", "error", extra={"traceback": "traceback"}
)

@patch("lifeguard_rabbitmq.validations.number_of_messages")
@patch("lifeguard_rabbitmq.validations.logger")
Expand Down

0 comments on commit 13bcb40

Please sign in to comment.