(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func TestIntegritySignature(t *testing.T) { |
| 58 | var integritySignature *IntegritySignature |
| 59 | attributes := SignatureAttributesMap{Ed25519publicKeyAttributeName: []byte("publickey")} |
| 60 | |
| 61 | integritySignature = &IntegritySignature{ |
| 62 | SignatureAttributes: attributes, |
| 63 | Signature: []byte("signature"), |
| 64 | } |
| 65 | |
| 66 | var integritySignatureBuf bytes.Buffer |
| 67 | enc := cbor.NewEncoder(&integritySignatureBuf) |
| 68 | if err := integritySignature.cborBytes(enc); err != nil { |
| 69 | t.Errorf("integritySignature.cborBytes. err: %v", err) |
| 70 | } |
| 71 | |
| 72 | want := `[map["ed25519PublicKey":"publickey"] "signature"]` |
| 73 | |
| 74 | got, err := testhelper.CborBinaryToReadableString(integritySignatureBuf.Bytes()) |
| 75 | if err != nil { |
| 76 | t.Fatal(err) |
| 77 | } |
| 78 | if got != want { |
| 79 | t.Errorf("integrityblock: got: %s\nwant: %s", got, want) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func TestComputeWebBundleSha512(t *testing.T) { |
| 84 | bundleFile, err := os.Open("./testfile.wbn") |
nothing calls this directly
no test coverage detected