feat(client): add get_station_recipes helper on APIClient

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-17 23:24:19 +02:00
parent 958f6ac0b0
commit a4a849920f
2 changed files with 21 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
"""Tests for the station-related helpers in api_client."""
from unittest.mock import patch
from services.api_client import APIClient
def test_get_station_recipes_calls_correct_endpoint():
client = APIClient()
with patch.object(client, "get") as mock_get:
mock_get.return_value = [{"id": 1, "code": "R1", "name": "R1", "active": True}]
result = client.get_station_recipes("ST-001")
# The helper must call the underlying .get() with the exact endpoint path.
called_args, called_kwargs = mock_get.call_args
assert called_args[0] == "/api/stations/by-code/ST-001/recipes"
assert result == [{"id": 1, "code": "R1", "name": "R1", "active": True}]