Show Eurostar seat availability and no-prices notice
fetch_prices now returns {'price': ..., 'seats': ...} per departure.
Seat count (labelled "N at this price") is shown below the fare — it
reflects price-band depth rather than total remaining seats. A yellow
notice is shown when the API returns journeys but all prices are null
(tickets not yet on sale).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cd37f0619b
commit
05eec29b7d
4 changed files with 38 additions and 17 deletions
|
|
@ -214,13 +214,13 @@ def test_results_shows_unreachable_morning_eurostar_services(monkeypatch):
|
|||
assert '2 Eurostar services unavailable from Bristol' in html
|
||||
assert '09:30' in html
|
||||
assert 'ES 9001' in html
|
||||
assert 'Unavailable from Bristol' in html
|
||||
assert 'Too early' in html
|
||||
assert html.index('09:30') < html.index('10:15')
|
||||
|
||||
|
||||
def test_results_shows_eurostar_price_and_total(monkeypatch):
|
||||
# 07:00 on Friday 2026-04-10 → Anytime £138.70 (weekday, 05:05–08:25 window)
|
||||
_stub_data(monkeypatch, prices={'10:01': 59})
|
||||
_stub_data(monkeypatch, prices={'10:01': {'price': 59, 'seats': 42}})
|
||||
client = _client()
|
||||
|
||||
resp = client.get('/results/paris/2026-04-10?min_connection=60&max_connection=120')
|
||||
|
|
@ -268,4 +268,4 @@ def test_results_can_show_only_unreachable_morning_services(monkeypatch):
|
|||
assert 'No valid journeys found.' not in html
|
||||
assert '1 Eurostar service unavailable from Bristol' in html
|
||||
assert '09:30' in html
|
||||
assert 'Unavailable from Bristol' in html
|
||||
assert 'Too early' in html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue