mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-23 05:41:19 -05:00
d67d0ac9df
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
35 lines
789 B
Go
35 lines
789 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
package client
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/api/attestationconfigapi"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestDeleteAzureSEVSNPVersions(t *testing.T) {
|
|
sut := Client{
|
|
bucketID: "bucket",
|
|
}
|
|
versions := attestationconfigapi.List{List: []string{"2023-01-01.json", "2021-01-01.json", "2019-01-01.json"}}
|
|
|
|
ops, err := sut.deleteVersion(versions, "2021-01-01")
|
|
|
|
assert := assert.New(t)
|
|
assert.NoError(err)
|
|
assert.Contains(ops, deleteCmd{
|
|
apiObject: attestationconfigapi.Entry{
|
|
Version: "2021-01-01.json",
|
|
},
|
|
})
|
|
|
|
assert.Contains(ops, putCmd{
|
|
apiObject: attestationconfigapi.List{List: []string{"2023-01-01.json", "2019-01-01.json"}},
|
|
})
|
|
}
|