fix missing error check, improve get test
All checks were successful
Go / build (1.21) (push) Successful in 1m18s
Go / build (1.22) (push) Successful in 1m17s

This commit is contained in:
saji 2024-03-01 16:33:30 -06:00
parent 68347e8b95
commit 7aaa47e142
2 changed files with 6 additions and 1 deletions

View file

@ -144,7 +144,9 @@ func TestTelemDb(t *testing.T) {
if err != nil {
t.Fatalf("error getting packets: %v", err)
}
t.Log(pkt)
if len(pkt) != 1 {
t.Fatalf("expected exactly one response, got %d", len(pkt))
}
})
t.Run("test read-write packet", func(t *testing.T) {

View file

@ -93,6 +93,9 @@ func (tdb *TelemDb) GetPackets(ctx context.Context, filter BusEventFilter, optio
Name: ev.Name,
}
BusEv.Data, err = skylab.FromJson(ev.Name, ev.Data)
if err != nil {
return events, nil
}
events = append(events, BusEv)
}