mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-07 00:35:17 -04:00
config: dynamic attestation configuration through S3 backed API (#1808)
This commit is contained in:
parent
25211dc154
commit
0a6e5ec02e
92 changed files with 1020 additions and 302 deletions
46
internal/api/configapi/attestationversion_test.go
Normal file
46
internal/api/configapi/attestationversion_test.go
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package configapi
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func TestVersionMarshalYAML(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
sut AttestationVersion
|
||||
want string
|
||||
}{
|
||||
{
|
||||
name: "isLatest resolves to latest",
|
||||
sut: AttestationVersion{
|
||||
Value: 1,
|
||||
IsLatest: true,
|
||||
},
|
||||
want: "latest\n",
|
||||
},
|
||||
{
|
||||
name: "value 5 resolves to 5",
|
||||
sut: AttestationVersion{
|
||||
Value: 5,
|
||||
IsLatest: false,
|
||||
},
|
||||
want: "5\n",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
bt, err := yaml.Marshal(tt.sut)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, tt.want, string(bt))
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue