Implement derived forecast modules
This commit is contained in:
@@ -66,6 +66,12 @@ func TestBuildDerivedDailySlicesDaypartsAndAlerts(t *testing.T) {
|
||||
if len(derived.DaypartSummaries) != 3 {
|
||||
t.Fatalf("DaypartSummaries length = %d, want 3", len(derived.DaypartSummaries))
|
||||
}
|
||||
if derived.PrecipTiming.FirstPrecipitation == nil || derived.PrecipTiming.FirstPrecipitation.Time.Format(time.RFC3339) != "2026-05-29T08:00:00-05:00" {
|
||||
t.Fatalf("PrecipTiming.FirstPrecipitation = %#v, want valid-period rain start", derived.PrecipTiming.FirstPrecipitation)
|
||||
}
|
||||
if !derived.PrecipTiming.ThunderMentioned {
|
||||
t.Fatal("PrecipTiming.ThunderMentioned = false, want true")
|
||||
}
|
||||
morning := derived.DailySummaries[0].Dayparts[0]
|
||||
if len(morning.HourlyPeriods) != 1 || morning.MaxPrecipitationProbability == nil || morning.MaxPrecipitationProbability.Value != 60 {
|
||||
t.Fatalf("morning summary = %#v, want sliced hour with precip max", morning)
|
||||
|
||||
Reference in New Issue
Block a user