Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): use correct rounding strategy #5373

Merged
merged 1 commit into from
Oct 22, 2024
Merged
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
6 changes: 3 additions & 3 deletions tests/incident_cost/test_incident_cost_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_calculate_incident_response_cost_with_cost_model(
):
"""Tests that the incident cost is calculated correctly when a cost model is enabled."""
from datetime import timedelta
from decimal import Decimal, ROUND_UP
from decimal import Decimal, ROUND_HALF_UP
from dispatch.incident_cost.service import update_incident_response_cost, get_hourly_rate
from dispatch.incident_cost_type import service as incident_cost_type_service
from dispatch.participant_activity.service import (
Expand Down Expand Up @@ -154,8 +154,8 @@ def test_calculate_incident_response_cost_with_cost_model(
) * hourly_rate + orig_total_incident_cost

assert cost
assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_UP)
assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_UP)
assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_HALF_UP)
assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_HALF_UP)


def test_calculate_incident_response_cost_with_cost_model__no_enabled_plugins(
Expand Down
Loading