Skip to content

Commit bb5b82b

Browse files
springdomcaptivit
authored andcommitted
fix: remove unused imports and update test schemas to use repeat_count
Fixes ruff lint failures: removed unused AsyncMock, MagicMock, patch, pytest, and backend.core.oncall imports from test_oncall.py. Updated schema tests to use repeat_count (int) instead of repeat (bool) to match the improved escalation policy model.
1 parent 8a3c2d8 commit bb5b82b

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

tests/test_oncall.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22

33
import uuid
44
from datetime import UTC, datetime, timedelta
5-
from unittest.mock import AsyncMock, MagicMock, patch
65

7-
import pytest
8-
9-
from backend.core.oncall import (
10-
find_escalation_policy,
11-
get_current_oncall,
12-
resolve_escalation_targets,
13-
)
146
from backend.models.oncall import (
157
EscalationPolicy,
168
OnCallOverride,
@@ -34,7 +26,6 @@
3426
ServiceMappingResponse,
3527
)
3628

37-
3829
# ─── Schema Validation Tests ─────────────────────────────
3930

4031

@@ -131,13 +122,13 @@ def test_current_response_no_user(self):
131122
class TestEscalationSchemas:
132123
def test_policy_create_defaults(self):
133124
p = EscalationPolicyCreate(name="Default Policy")
134-
assert p.repeat is False
125+
assert p.repeat_count == 0
135126
assert p.levels == []
136127

137128
def test_policy_create_with_levels(self):
138129
p = EscalationPolicyCreate(
139130
name="Multi-Level",
140-
repeat=True,
131+
repeat_count=3,
141132
levels=[
142133
{
143134
"level": 1,
@@ -152,20 +143,20 @@ def test_policy_create_with_levels(self):
152143
],
153144
)
154145
assert len(p.levels) == 2
155-
assert p.repeat is True
146+
assert p.repeat_count == 3
156147

157148
def test_policy_update_partial(self):
158-
p = EscalationPolicyUpdate(repeat=True)
149+
p = EscalationPolicyUpdate(repeat_count=2)
159150
dumped = p.model_dump(exclude_unset=True)
160-
assert "repeat" in dumped
151+
assert "repeat_count" in dumped
161152
assert "name" not in dumped
162153

163154
def test_policy_response(self):
164155
now = datetime.now(UTC)
165156
data = {
166157
"id": uuid.uuid4(),
167158
"name": "Default",
168-
"repeat": False,
159+
"repeat_count": 0,
169160
"levels": [],
170161
"created_at": now,
171162
"updated_at": now,

0 commit comments

Comments
 (0)