Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit db2d04d

Browse files
authored
Correcting rounding strategy (#5373)
1 parent 70b554a commit db2d04d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/incident_cost/test_incident_cost_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_calculate_incident_response_cost_with_cost_model(
109109
):
110110
"""Tests that the incident cost is calculated correctly when a cost model is enabled."""
111111
from datetime import timedelta
112-
from decimal import Decimal, ROUND_UP
112+
from decimal import Decimal, ROUND_HALF_UP
113113
from dispatch.incident_cost.service import update_incident_response_cost, get_hourly_rate
114114
from dispatch.incident_cost_type import service as incident_cost_type_service
115115
from dispatch.participant_activity.service import (
@@ -154,8 +154,8 @@ def test_calculate_incident_response_cost_with_cost_model(
154154
) * hourly_rate + orig_total_incident_cost
155155

156156
assert cost
157-
assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_UP)
158-
assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_UP)
157+
assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_HALF_UP)
158+
assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_HALF_UP)
159159

160160

161161
def test_calculate_incident_response_cost_with_cost_model__no_enabled_plugins(

0 commit comments

Comments
 (0)