Skip to content

Commit

Permalink
add required field
Browse files Browse the repository at this point in the history
  • Loading branch information
DGaffney committed Aug 29, 2023
1 parent 928481c commit 76c819e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/lib/queue/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def test_send_callbacks(self):

@patch('lib.queue.processor.requests.post')
def test_send_callback(self, mock_post):
message_body = schemas.Message(body={"callback_url": "http://example.com", "text": "This is a test"}, response=[1,2,3])
message_body = schemas.Message(body={"callback_url": "http://example.com", "text": "This is a test", "id": 123}, response=[1,2,3])
self.queue_processor.send_callback(message_body)

mock_post.assert_called_once_with("http://example.com", json=message_body)

@patch('lib.queue.processor.requests.post')
def test_send_callback_failure(self, mock_post):
mock_post.side_effect = Exception("Request Failed!")
message_body = schemas.Message(body={"callback_url": "http://example.com", "text": "This is a test"}, response=[1,2,3])
message_body = schemas.Message(body={"callback_url": "http://example.com", "text": "This is a test", "id": 123}, response=[1,2,3])

with self.assertLogs(level='ERROR') as cm:
self.queue_processor.send_callback(message_body)
Expand Down

0 comments on commit 76c819e

Please sign in to comment.