mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 06:16:08 -04:00
Purge provider argument from constellation create and verify
This commit is contained in:
parent
7aded65ea8
commit
ce0edc8c80
9 changed files with 31 additions and 233 deletions
|
@ -33,7 +33,6 @@ import (
|
|||
"github.com/edgelesssys/constellation/internal/oid"
|
||||
"github.com/edgelesssys/constellation/internal/state"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/grpc"
|
||||
|
@ -273,45 +272,6 @@ func TestWriteOutput(t *testing.T) {
|
|||
assert.Equal(expectedIDFile, testIDFile)
|
||||
}
|
||||
|
||||
func TestInitCompletion(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
args []string
|
||||
toComplete string
|
||||
wantResult []string
|
||||
wantShellCD cobra.ShellCompDirective
|
||||
}{
|
||||
"first arg": {
|
||||
args: []string{},
|
||||
toComplete: "hello",
|
||||
wantResult: []string{},
|
||||
wantShellCD: cobra.ShellCompDirectiveDefault,
|
||||
},
|
||||
"secnod arg": {
|
||||
args: []string{"23"},
|
||||
toComplete: "/test/h",
|
||||
wantResult: []string{},
|
||||
wantShellCD: cobra.ShellCompDirectiveError,
|
||||
},
|
||||
"third arg": {
|
||||
args: []string{"./file", "sth"},
|
||||
toComplete: "./file",
|
||||
wantResult: []string{},
|
||||
wantShellCD: cobra.ShellCompDirectiveError,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
cmd := &cobra.Command{}
|
||||
result, shellCD := initCompletion(cmd, tc.args, tc.toComplete)
|
||||
assert.Equal(tc.wantResult, result)
|
||||
assert.Equal(tc.wantShellCD, shellCD)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadOrGenerateMasterSecret(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
filename string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue