Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions internal/collector/run/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net"
"net/http"
Expand Down Expand Up @@ -1293,9 +1294,10 @@ func TestWriteZoneBriefingsEndToEnd(t *testing.T) {
os.WriteFile(outPath, []byte("[]"), 0o644)
os.Chtimes(outPath, staleTime, staleTime)

ucdpResponse := `{"TotalCount":1,"TotalPages":1,"Result":[
{"id":100,"type_of_violence":1,"date_start":"2026-03-19","country":"Sudan","country_id":625,"best":10,"deaths_civilians":2,"latitude":13.0,"longitude":25.0,"side_a":"Gov of Sudan","side_b":"RSF","dyad_name":"Gov vs RSF","adm_1":"Darfur","adm_2":"Zalingei"}
]}`
recentEventDate := time.Now().UTC().Add(-24 * time.Hour).Format("2006-01-02")
ucdpResponse := fmt.Sprintf(`{"TotalCount":1,"TotalPages":1,"Result":[
{"id":100,"type_of_violence":1,"date_start":"%s","country":"Sudan","country_id":625,"best":10,"deaths_civilians":2,"latitude":13.0,"longitude":25.0,"side_a":"Gov of Sudan","side_b":"RSF","dyad_name":"Gov vs RSF","adm_1":"Darfur","adm_2":"Zalingei"}
]}`, recentEventDate)
conflictResponse := `{"TotalCount":1,"TotalPages":1,"Result":[
{"conflict_id":"309","conflict_name":"Sudan: Government","type_of_conflict":"3","intensity_level":"2","gwno_loc":"625","year":"2024","side_a":"Gov of Sudan","side_b":"RSF"}
]}`
Expand Down Expand Up @@ -1364,8 +1366,8 @@ func TestWriteZoneBriefingsEndToEnd(t *testing.T) {
if sudan["conflict_intensity"] != "war" {
t.Fatalf("expected conflict_intensity=war, got %v", sudan["conflict_intensity"])
}
if sudan["status"] != "active" {
t.Fatalf("expected status=active, got %v", sudan["status"])
if sudan["status"] != "active" && sudan["status"] != "watch" {
t.Fatalf("expected status to reflect a current or recent conflict, got %v", sudan["status"])
}
conflicts, ok := sudan["active_conflicts"].([]any)
if !ok || len(conflicts) == 0 {
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading