Skip to content

Commit

Permalink
Updated tests in victorops_test.py to accommodate new fields passed…
Browse files Browse the repository at this point in the history
… to alert payload.

* Needed by jertel#329
  • Loading branch information
ChristophShyper committed Jul 20, 2021
1 parent 4c74ab5 commit 81a1f8b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/alerters/victorops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def test_victorops(caplog):
'message_type': rule['victorops_message_type'],
'entity_display_name': rule['victorops_entity_display_name'],
'monitoring_tool': 'ElastAlert',
'state_message': 'Test VictorOps Rule\n\n@timestamp: 2021-01-01T00:00:00\nsomefield: foobarbaz\n'
'state_message': 'Test VictorOps Rule\n\n@timestamp: 2021-01-01T00:00:00\nsomefield: foobarbaz\n',
'@timestamp': '2021-01-01T00:00:00',
'somefield': 'foobarbaz'
}

mock_post_request.assert_called_once_with(
Expand Down Expand Up @@ -76,7 +78,9 @@ def test_victorops_proxy():
'message_type': rule['victorops_message_type'],
'entity_display_name': rule['victorops_entity_display_name'],
'monitoring_tool': 'ElastAlert',
'state_message': 'Test VictorOps Rule\n\n@timestamp: 2021-01-01T00:00:00\nsomefield: foobarbaz\n'
'state_message': 'Test VictorOps Rule\n\n@timestamp: 2021-01-01T00:00:00\nsomefield: foobarbaz\n',
'@timestamp': '2021-01-01T00:00:00',
'somefield': 'foobarbaz'
}

mock_post_request.assert_called_once_with(
Expand Down Expand Up @@ -141,7 +145,9 @@ def test_victorops_entity_id():
'entity_display_name': rule['victorops_entity_display_name'],
'monitoring_tool': 'ElastAlert',
'state_message': 'Test VictorOps Rule\n\n@timestamp: 2021-01-01T00:00:00\nsomefield: foobarbaz\n',
'entity_id': '12345'
'entity_id': '12345',
'@timestamp': '2021-01-01T00:00:00',
'somefield': 'foobarbaz'
}

mock_post_request.assert_called_once_with(
Expand Down Expand Up @@ -186,7 +192,9 @@ def test_victorops_message_type(message_type, except_message_type):
'message_type': except_message_type,
'entity_display_name': rule['victorops_entity_display_name'],
'monitoring_tool': 'ElastAlert',
'state_message': 'Test VictorOps Rule\n\n@timestamp: 2021-01-01T00:00:00\nsomefield: foobarbaz\n'
'state_message': 'Test VictorOps Rule\n\n@timestamp: 2021-01-01T00:00:00\nsomefield: foobarbaz\n',
'@timestamp': '2021-01-01T00:00:00',
'somefield': 'foobarbaz'
}

mock_post_request.assert_called_once_with(
Expand Down

0 comments on commit 81a1f8b

Please sign in to comment.