Download this file
| 1 | package team |
| 2 | |
| 3 | import ( |
| 4 | "encoding/json" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func TestPublicationAcceptsContainedIsolation(t *testing.T) { |
| 9 | g := newGitEnv(t) |
| 10 | g.build() |
| 11 | g.review() |
| 12 | g.verify(true) |
| 13 | h := g.claimStep("publish") |
| 14 | p, err := g.store.Publication(g.ctx, g.scope, h) |
| 15 | must(t, err) |
| 16 | var d PublicationDescription |
| 17 | must(t, json.Unmarshal([]byte(p.Description), &d)) |
| 18 | d.Isolation.AcknowledgementIDs = append(d.Isolation.AcknowledgementIDs, "extra") |
| 19 | for i := range d.Evidence { |
| 20 | d.Evidence[i].Provenance.Isolation.AcknowledgementIDs = append(d.Evidence[i].Provenance.Isolation.AcknowledgementIDs, "extra") |
| 21 | } |
| 22 | p.Description = string(mustJSON(d)) |
| 23 | p.DescriptionHash = hashBytes([]byte(p.Description)) |
| 24 | _, err = g.store.Intend(g.ctx, g.scope, h, IntentSpec{Key: "superset", Operation: OpForgePublish, Payload: mustJSON(p), Reserve: Usage{Calls: 1}}) |
| 25 | must(t, err) |
| 26 | } |
| 27 | |