Skip to content

Commit

Permalink
Increase test coverage of ReplayMarkerStorage.get_message_date
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmrk committed Jan 5, 2019
1 parent ce207eb commit 8d4ed9b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_replay.py
Expand Up @@ -182,12 +182,13 @@ def test_get_message_date_for_platform_event(self):
self.assertEqual(result, date)

def test_get_message_date_error_if_no_date_found(self):
date = datetime.now(timezone.utc).isoformat()
message = {}
with self.assertRaisesRegex(ReplayError,
"No message creation date found."):
self.replay_storage.get_message_date({})

with self.assertRaisesRegex(ReplayError,
"No message creation date found."):
self.replay_storage.get_message_date(message)
self.replay_storage.get_message_date({"data": {}})

async def test_extract_replay_id_on_no_previous_id(self):
self.replay_storage.set_replay_marker = mock.CoroutineMock()
Expand Down

0 comments on commit 8d4ed9b

Please sign in to comment.