mcchunkie/got_test.go
Aaron Bieber 95fea0358e
got: switch to auth_user.. woops
actually save the json as is, not what we parse
2024-04-30 10:12:35 -06:00

28 lines
412 B
Go

package main
import (
"bytes"
"encoding/json"
"fmt"
"os"
"testing"
)
func TestGotNotification(t *testing.T) {
jsonData, err := os.ReadFile("test_body.json")
if err != nil {
t.Fatal(err)
}
nots := &GotNotifications{}
dec := json.NewDecoder(bytes.NewReader(jsonData))
err = dec.Decode(nots)
if err != nil {
t.Fatal(err)
}
for _, n := range nots.Notifications {
fmt.Println(n.String())
}
}