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

Function Test_PrintOutputsExpectedJSON

internal/output/output_test.go:179–222  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

177}
178
179func Test_PrintOutputsExpectedJSON(t *testing.T) {
180 // we don't care much about content as much as the JSON encoding is correct
181 outputs := Outputs{
182 {},
183 {},
184 }
185
186 var buff bytes.Buffer
187
188 outputs.Print(&buff)
189
190 assert.JSONEq(t, `[
191 {
192 "imageSignatureCheck": {
193 "passed": false
194 },
195 "imageAccessibleCheck": {
196 "passed": false
197 },
198 "attestationSignatureCheck": {
199 "passed": false
200 },
201 "attestationSyntaxCheck": {
202 "passed": false
203 },
204 "policyCheck": null
205 },
206 {
207 "imageSignatureCheck": {
208 "passed": false
209 },
210 "imageAccessibleCheck": {
211 "passed": false
212 },
213 "attestationSignatureCheck": {
214 "passed": false
215 },
216 "attestationSyntaxCheck": {
217 "passed": false
218 },
219 "policyCheck": null
220 }
221 ]`, buff.String())
222}
223
224func Test_Violations(t *testing.T) {
225 cases := []struct {

Callers

nothing calls this directly

Calls 2

PrintMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected