@@ -16,9 +16,6 @@ import (
1616 "github.com/stackitcloud/stackit-sdk-go/services/objectstorage"
1717)
1818
19- var projectIdFlag = globalflags .ProjectIdFlag
20- var regionFlag = globalflags .RegionFlag
21-
2219type testCtxKey struct {}
2320
2421var testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
@@ -28,9 +25,9 @@ var testRegion = "eu01"
2825
2926func fixtureFlagValues (mods ... func (flagValues map [string ]string )) map [string ]string {
3027 flagValues := map [string ]string {
31- projectIdFlag : testProjectId ,
32- limitFlag : "10" ,
33- regionFlag : testRegion ,
28+ globalflags . ProjectIdFlag : testProjectId ,
29+ limitFlag : "10" ,
30+ globalflags . RegionFlag : testRegion ,
3431 }
3532 for _ , mod := range mods {
3633 mod (flagValues )
@@ -83,21 +80,21 @@ func TestParseInput(t *testing.T) {
8380 {
8481 description : "project id missing" ,
8582 flagValues : fixtureFlagValues (func (flagValues map [string ]string ) {
86- delete (flagValues , projectIdFlag )
83+ delete (flagValues , globalflags . ProjectIdFlag )
8784 }),
8885 isValid : false ,
8986 },
9087 {
9188 description : "project id invalid 1" ,
9289 flagValues : fixtureFlagValues (func (flagValues map [string ]string ) {
93- flagValues [projectIdFlag ] = ""
90+ flagValues [globalflags . ProjectIdFlag ] = ""
9491 }),
9592 isValid : false ,
9693 },
9794 {
9895 description : "project id invalid 2" ,
9996 flagValues : fixtureFlagValues (func (flagValues map [string ]string ) {
100- flagValues [projectIdFlag ] = "invalid-uuid"
97+ flagValues [globalflags . ProjectIdFlag ] = "invalid-uuid"
10198 }),
10299 isValid : false ,
103100 },
@@ -155,6 +152,7 @@ func TestBuildRequest(t *testing.T) {
155152func TestOutputResult (t * testing.T ) {
156153 type args struct {
157154 outputFormat string
155+ projectLabel string
158156 buckets []objectstorage.Bucket
159157 }
160158 tests := []struct {
@@ -179,7 +177,7 @@ func TestOutputResult(t *testing.T) {
179177 p .Cmd = NewCmd (& params.CmdParams {Printer : p })
180178 for _ , tt := range tests {
181179 t .Run (tt .name , func (t * testing.T ) {
182- if err := outputResult (p , tt .args .outputFormat , tt .args .buckets ); (err != nil ) != tt .wantErr {
180+ if err := outputResult (p , tt .args .outputFormat , tt .args .projectLabel , tt . args . buckets ); (err != nil ) != tt .wantErr {
183181 t .Errorf ("outputResult() error = %v, wantErr %v" , err , tt .wantErr )
184182 }
185183 })
0 commit comments