fix: resolve 4 logic bugs found in code review
- utc_to_eastern: use zoneinfo instead of hardcoded EDT offset (-4) so start times are correct in both EST and EDT - standings: fetch before truncate so a failed API call doesn't wipe existing standings data - routes: call parse_games() once per request instead of three times - scheduler: wrap run_pending() in try/except so an unhandled exception doesn't kill the background thread Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -101,10 +101,16 @@ class TestGetGameOutcome:
|
||||
|
||||
|
||||
class TestUtcToEstTime:
|
||||
def test_converts_utc_to_est(self):
|
||||
def test_converts_utc_to_edt(self):
|
||||
# April is EDT (UTC-4): 23:00 UTC → 07:00 PM EDT
|
||||
result = utc_to_eastern("2024-04-10T23:00:00Z")
|
||||
assert result == "07:00 PM"
|
||||
|
||||
def test_converts_utc_to_est(self):
|
||||
# January is EST (UTC-5): 23:00 UTC → 06:00 PM EST
|
||||
result = utc_to_eastern("2024-01-15T23:00:00Z")
|
||||
assert result == "06:00 PM"
|
||||
|
||||
|
||||
class TestParseGames:
|
||||
def test_returns_empty_list_for_none(self):
|
||||
|
||||
Reference in New Issue
Block a user