Skip to content

Commit

Permalink
TST: Improve test docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Feb 5, 2024
1 parent 1222e83 commit 2ca04d8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/cloud/pub_sub/test_message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,17 @@ def test_total_run_time_is_none_if_handle_messages_has_not_been_called(self):
message_handler = OrderedMessageHandler(subscription=mock_subscription, receiving_service=parent)
self.assertIsNone(message_handler.total_run_time)

def test_time_since_missing_message_is_none_if_no_missing_messages(self):
def test_time_since_missing_message_is_none_if_no_unhandled_missing_messages(self):
"""Test that the `OrderedMessageHandler.time_since_missing_message` property is `None` if there are no unhandled
missing messages.
"""
question_uuid, _, mock_subscription = create_mock_topic_and_subscription()
message_handler = OrderedMessageHandler(subscription=mock_subscription, receiving_service=parent)
self.assertIsNone(message_handler.time_since_missing_message)

def test_missing_messages_at_start_can_be_skipped(self):
"""Test that the first n messages can be skipped if they aren't received after a given time period if subsequent
messages have been received.
"""Test that missing messages at the start of the event stream can be skipped if they aren't received after a
given time period if subsequent messages have been received.
"""
question_uuid, mock_topic, mock_subscription = create_mock_topic_and_subscription()

Expand Down Expand Up @@ -570,7 +573,7 @@ def test_all_messages_missing_apart_from_result(self):
self.assertEqual(message_handler.handled_messages, [{"kind": "finish-test", "order": 1000}])


class TestPullAndEnqueueMessage(BaseTestCase):
class TestPullAndEnqueueAvailableMessages(BaseTestCase):
def test_pull_and_enqueue_available_messages(self):
"""Test that pulling and enqueuing a message works."""
question_uuid, mock_topic, _ = create_mock_topic_and_subscription()
Expand Down

0 comments on commit 2ca04d8

Please sign in to comment.