chore: clean up pre-existing ruff violations in tests
Remove unused imports (F401) and strip trailing whitespace (W291/W293) flagged by ruff in test files. Pre-existing debt unrelated to any single feature; CI runs pytest but not ruff, so these had accumulated. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGzHtDvJur9U7ysgRKRUTN
This commit is contained in:
@@ -12,10 +12,8 @@ import time
|
||||
import types
|
||||
|
||||
import jwt
|
||||
import pytest
|
||||
from cryptography.hazmat.primitives.asymmetric import ed25519, rsa
|
||||
|
||||
from intervals_mcp_server import auth as auth_mod
|
||||
from intervals_mcp_server.auth import AuthentikTokenVerifier, _audience_variants, build_auth
|
||||
|
||||
ISSUER = "https://auth.example/application/o/x/"
|
||||
|
||||
@@ -8,7 +8,6 @@ and the error/empty branches.
|
||||
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
|
||||
from intervals_mcp_server.tools import custom_items
|
||||
|
||||
@@ -60,7 +59,7 @@ def test_create_builds_full_payload(monkeypatch):
|
||||
rec = _patch(monkeypatch, lambda _k: {"id": 9, "name": "Chart", "type": "FITNESS_CHART"})
|
||||
out = _run(
|
||||
custom_items.create_custom_item(
|
||||
name="Chart", item_type="FITNESS_CHART",
|
||||
name="Chart", item_type="FITNESS_CHART",
|
||||
description="desc", content={"a": 1}, visibility="PRIVATE",
|
||||
)
|
||||
)
|
||||
|
||||
@@ -112,7 +112,7 @@ def test_add_event_posts_when_no_event_id(monkeypatch):
|
||||
rec = _patch(monkeypatch, lambda _k: {"id": "e99"})
|
||||
out = _run(
|
||||
events.add_or_update_event(
|
||||
workout_type="Ride", name="Threshold",
|
||||
workout_type="Ride", name="Threshold",
|
||||
start_date="2026-07-10", moving_time=3600, distance=40000,
|
||||
workout_doc=WorkoutDoc(description="d", steps=[Step(duration=600)]),
|
||||
)
|
||||
@@ -128,7 +128,7 @@ def test_update_event_puts_when_event_id(monkeypatch):
|
||||
rec = _patch(monkeypatch, lambda _k: {"id": "e5"})
|
||||
_run(
|
||||
events.add_or_update_event(
|
||||
workout_type="Ride", name="Threshold",
|
||||
workout_type="Ride", name="Threshold",
|
||||
event_id="e5", start_date="2026-07-10",
|
||||
)
|
||||
)
|
||||
|
||||
@@ -465,7 +465,7 @@ def test_get_athlete_power_curves(monkeypatch):
|
||||
result = asyncio.run(
|
||||
get_athlete_power_curves(
|
||||
activity_type="Ride",
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
assert "Power Curves (Ride):" in result
|
||||
@@ -492,7 +492,7 @@ def test_get_athlete_power_curves_custom_durations(monkeypatch):
|
||||
get_athlete_power_curves(
|
||||
activity_type="Ride",
|
||||
durations=[5, 60],
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
assert "5s:" in result
|
||||
@@ -518,7 +518,7 @@ def test_get_athlete_power_curves_without_normalised(monkeypatch):
|
||||
get_athlete_power_curves(
|
||||
activity_type="Ride",
|
||||
include_normalised=False,
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
assert "W/kg" not in result
|
||||
@@ -542,7 +542,7 @@ def test_get_athlete_power_curves_date_validation(monkeypatch):
|
||||
get_athlete_power_curves(
|
||||
activity_type="Ride",
|
||||
start_date="2026-01-01",
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
assert "Error" in result
|
||||
@@ -566,7 +566,7 @@ def test_get_athlete_power_curves_no_curves_selected(monkeypatch):
|
||||
activity_type="Ride",
|
||||
this_season=False,
|
||||
last_season=False,
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
assert "Error" in result
|
||||
@@ -675,7 +675,7 @@ def test_create_custom_item_with_string_content(monkeypatch):
|
||||
create_custom_item(
|
||||
name="Activity Field",
|
||||
item_type="ACTIVITY_FIELD",
|
||||
|
||||
|
||||
content='{"expression": "icu_training_load"}', # type: ignore[arg-type]
|
||||
)
|
||||
)
|
||||
@@ -744,7 +744,7 @@ def test_create_custom_item_with_invalid_json_content(monkeypatch):
|
||||
create_custom_item(
|
||||
name="Bad Item",
|
||||
item_type="FITNESS_CHART",
|
||||
|
||||
|
||||
content="not valid json", # type: ignore[arg-type]
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user