Download this file
| 1 | package plan3test |
| 2 | |
| 3 | import ( |
| 4 | "amadan.net/oficina/equipo/internal/equipo" |
| 5 | "amadan.net/oficina/equipo/internal/runnerproto" |
| 6 | "amadan.net/rastrillo/rastrillo/mail" |
| 7 | "encoding/json" |
| 8 | "io" |
| 9 | "log/slog" |
| 10 | "testing" |
| 11 | ) |
| 12 | |
| 13 | func notificationToolCall(id string, body json.RawMessage) runnerproto.CoordinatorToolCall { |
| 14 | return runnerproto.CoordinatorToolCall{RequestID: id, Name: "ask_person", Arguments: body} |
| 15 | } |
| 16 | func notificationRouter(t *testing.T, f *fixture, s *equipo.Store) { |
| 17 | t.Helper() |
| 18 | logger := slog.New(slog.NewTextHandler(io.Discard, nil)) |
| 19 | h, err := equipo.RouterWithStore(f.DB, equipo.Config{Origin: origin, InstanceKey: "plan3-fixture", AllowLoggedMail: true, Owners: []string{owner.Address}}, mail.Logged(logger), logger, s) |
| 20 | must(t, err) |
| 21 | f.Store = s |
| 22 | f.Handler = equipo.Mux(h) |
| 23 | } |
| 24 | |
| 25 | func notificationPlanWait(t *testing.T, f *fixture, id string) { |
| 26 | t.Helper() |
| 27 | f.exec(t, "UPDATE tasks SET wait_code='plan.awaiting_approval' WHERE id=?", id) |
| 28 | } |
| 29 | |