mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-15 10:15:33 -04:00
Wrote and applied helper function for tests
replaced with new function removed log/slog readded log/slog when needed fixed last testwriter problems
This commit is contained in:
parent
944bdedc59
commit
76ada50c17
55 changed files with 133 additions and 178 deletions
|
@ -8,7 +8,6 @@ package cmd
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
@ -93,7 +92,7 @@ func TestConfigGenerateDefault(t *testing.T) {
|
|||
cmd := newConfigGenerateCmd()
|
||||
|
||||
cg := &configGenerateCmd{
|
||||
log: slog.New(slog.NewTextHandler(logger.TestWriter{T: t}, nil)),
|
||||
log: logger.NewTest(t),
|
||||
flags: generateFlags{
|
||||
attestationVariant: variant.Dummy{},
|
||||
k8sVersion: versions.Default,
|
||||
|
@ -145,7 +144,7 @@ func TestConfigGenerateDefaultProviderSpecific(t *testing.T) {
|
|||
wantConf.RemoveProviderAndAttestationExcept(tc.provider)
|
||||
|
||||
cg := &configGenerateCmd{
|
||||
log: slog.New(slog.NewTextHandler(logger.TestWriter{T: t}, nil)),
|
||||
log: logger.NewTest(t),
|
||||
flags: generateFlags{
|
||||
attestationVariant: variant.Dummy{},
|
||||
k8sVersion: versions.Default,
|
||||
|
@ -178,7 +177,7 @@ func TestConfigGenerateDefaultExists(t *testing.T) {
|
|||
cmd := newConfigGenerateCmd()
|
||||
|
||||
cg := &configGenerateCmd{
|
||||
log: slog.New(slog.NewTextHandler(logger.TestWriter{T: t}, nil)),
|
||||
log: logger.NewTest(t),
|
||||
flags: generateFlags{attestationVariant: variant.Dummy{}},
|
||||
}
|
||||
require.Error(cg.configGenerate(cmd, fileHandler, cloudprovider.Unknown, ""))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue