@@ -16,8 +16,6 @@ import (
1616 "github.com/stackitcloud/stackit-sdk-go/services/iaas"
1717)
1818
19- var projectIdFlag = globalflags .ProjectIdFlag
20-
2119type testCtxKey struct {}
2220
2321var (
2826
2927func fixtureFlagValues (mods ... func (flagValues map [string ]string )) map [string ]string {
3028 flagValues := map [string ]string {
31- projectIdFlag : testProjectId ,
32- limitFlag : "10" ,
33- labelSelectorFlag : "key1=value1" ,
29+ globalflags . ProjectIdFlag : testProjectId ,
30+ limitFlag : "10" ,
31+ labelSelectorFlag : "key1=value1" ,
3432 }
3533 for _ , mod := range mods {
3634 mod (flagValues )
@@ -83,21 +81,21 @@ func TestParseInput(t *testing.T) {
8381 {
8482 description : "project id missing" ,
8583 flagValues : fixtureFlagValues (func (flagValues map [string ]string ) {
86- delete (flagValues , projectIdFlag )
84+ delete (flagValues , globalflags . ProjectIdFlag )
8785 }),
8886 isValid : false ,
8987 },
9088 {
9189 description : "project id invalid 1" ,
9290 flagValues : fixtureFlagValues (func (flagValues map [string ]string ) {
93- flagValues [projectIdFlag ] = ""
91+ flagValues [globalflags . ProjectIdFlag ] = ""
9492 }),
9593 isValid : false ,
9694 },
9795 {
9896 description : "project id invalid 2" ,
9997 flagValues : fixtureFlagValues (func (flagValues map [string ]string ) {
100- flagValues [projectIdFlag ] = "invalid-uuid"
98+ flagValues [globalflags . ProjectIdFlag ] = "invalid-uuid"
10199 }),
102100 isValid : false ,
103101 },
@@ -209,9 +207,9 @@ func TestOutputResult(t *testing.T) {
209207 wantErr : true ,
210208 },
211209 {
212- name : "set empty create backup response " ,
210+ name : "empty backup in slice " ,
213211 args : args {
214- backups : []iaas.Backup {},
212+ backups : []iaas.Backup {{} },
215213 },
216214 wantErr : false ,
217215 },
0 commit comments