MCPcopy Create free account
hub / github.com/conforma/cli / TestService_ProcessSnapshotVSA

Function TestService_ProcessSnapshotVSA

internal/validate/vsa/service_test.go:177–206  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

175}
176
177func TestService_ProcessSnapshotVSA(t *testing.T) {
178 ctx := context.Background()
179 fs := afero.NewMemMapFs()
180
181 // Create test data
182 report := applicationsnapshot.Report{
183 Success: true,
184 Policy: ecc.EnterpriseContractPolicySpec{},
185 Components: []applicationsnapshot.Component{
186 {
187 SnapshotComponent: app.SnapshotComponent{
188 Name: "test-component",
189 ContainerImage: "quay.io/test/image:tag",
190 },
191 Success: true,
192 },
193 },
194 }
195
196 // Create test signer
197 signer := testSigner("/test.key", fs)
198 service := NewServiceWithFS(signer, fs, "https://github.com/test/policy", nil, "vsa-")
199
200 // Test successful processing
201 envelopePath, err := service.ProcessSnapshotVSA(ctx, report)
202
203 assert.NoError(t, err)
204 assert.NotEmpty(t, envelopePath)
205 assert.Contains(t, envelopePath, ".intoto.jsonl")
206}
207
208func TestService_ProcessAllVSAs(t *testing.T) {
209 ctx := context.Background()

Callers

nothing calls this directly

Calls 3

testSignerFunction · 0.85
NewServiceWithFSFunction · 0.85
ProcessSnapshotVSAMethod · 0.80

Tested by

no test coverage detected