MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / newGraphHTTPOn

Function newGraphHTTPOn

internal/server/commitment_graph_entry_test.go:25–43  ·  view source on GitHub ↗
(t *testing.T, srv *Server, roles ...models.CommitmentRolesInput)

Source from the content-addressed store, hash-verified

23 return newGraphHTTPOn(t, testServer(t), roles...)
24}
25func newGraphHTTPOn(t *testing.T, srv *Server, roles ...models.CommitmentRolesInput) *graphHTTP {
26 f := &graphHTTP{schedHTTP: newSchedHTTPOn(t, srv), access: models.CommitmentAccess{Readable: map[string]bool{}, Editable: map[string]bool{}}}
27 for i, r := range roles {
28 it := f.item
29 if i > 0 {
30 it = mustItem(t, f.srv, f.ws.ID, f.coll.ID, "Graph item")
31 }
32 start := time.Now().UTC().Truncate(time.Second).Add(time.Duration(10+i) * 24 * time.Hour)
33 sc, err := f.srv.store.CreateCommitmentSchedule(f.ws.ID, it.ID, models.ScheduleCreate{Dtstart: start.Format("2006-01-02T15:04:05"), Tz: "UTC"}, r)
34 if err != nil {
35 t.Fatal(err)
36 }
37 f.items = append(f.items, it)
38 f.dates = append(f.dates, *sc.NextAt)
39 f.access.Readable[it.ID] = true
40 f.access.Editable[it.ID] = true
41 }
42 return f
43}
44func graphHard() models.CommitmentRolesInput {
45 d, s, b := 2, 0, "stays_owed"
46 return models.CommitmentRolesInput{DeadlineDays: &d, DeadlineSecs: &s, DeadlineBehavior: &b}

Callers 2

newGraphHTTPFunction · 0.85
newGraphPublishFixFunction · 0.85

Calls 8

newSchedHTTPOnFunction · 0.85
mustItemFunction · 0.85
appendFunction · 0.85
FormatMethod · 0.80
FatalMethod · 0.80
AddMethod · 0.65
NowMethod · 0.65

Tested by

no test coverage detected