Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/test_incidents.py
Original file line number Diff line number Diff line change
Expand Up @@ -2037,11 +2037,14 @@ def test_incident_dto_is_visible_from_db(db_session, create_alert):
def test_incident_dto_is_visible_to_db():
"""Test that is_visible is correctly mapped in IncidentDto.to_db_incident()."""
from keep.api.models.incident import IncidentDto
from keep.api.models.db.incident import IncidentSeverity, IncidentStatus
import datetime

dto = IncidentDto(
id=uuid4(),
user_generated_name="Test",
severity=IncidentSeverity.INFO,
status=IncidentStatus.FIRING.value,
is_predicted=False,
is_candidate=False,
is_visible=False,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_keep_provider_notify_alert_none.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def test_notify_alert_with_none_alert_results_no_crash():
provider.io_handler = MagicMock()
provider.io_handler.render_context.return_value = {}

# Mock pusher and alert DAO to avoid DB dependency
with patch("keep.providers.keep_provider.keep_provider.Pusher"), \
# Mock process_event and alert DAO to avoid DB dependency
with patch("keep.providers.keep_provider.keep_provider.process_event"), \
patch.object(provider, "logger"):
# Before the fix, this would raise:
# TypeError: object of type 'NoneType' has no len()
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_notify_alert_with_none_alert_results_and_alert_param():
provider.io_handler = MagicMock()
provider.io_handler.render_context.return_value = alert_data

with patch("keep.providers.keep_provider.keep_provider.Pusher"), \
with patch("keep.providers.keep_provider.keep_provider.process_event"), \
patch.object(provider, "logger"):
# This should work: alert param provides the alert data
result = provider._notify_alert(alert=alert_data)
Expand Down
Loading