@@ -10,16 +10,21 @@ import (
1010 "github.com/stackitcloud/stackit-cli/internal/cmd/params"
1111 "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
1212 "github.com/stackitcloud/stackit-cli/internal/pkg/print"
13- "github.com/stackitcloud/stackit-cli/internal/pkg/utils"
1413 "github.com/stackitcloud/stackit-sdk-go/services/iaas"
1514)
1615
16+ const (
17+ projectIdFlag = globalflags .ProjectIdFlag
18+ regionFlag = globalflags .RegionFlag
19+
20+ testRegion = "eu01"
21+ )
22+
1723type testCtxKey struct {}
1824
1925var testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
2026var testClient = & iaas.APIClient {}
2127
22- var projectIdFlag = globalflags .ProjectIdFlag
2328var testProjectId = uuid .NewString ()
2429var testNetworkId = uuid .NewString ()
2530var testNicId = uuid .NewString ()
@@ -37,6 +42,7 @@ func fixtureArgValues(mods ...func(argValues []string)) []string {
3742func fixtureFlagValues (mods ... func (flagValues map [string ]string )) map [string ]string {
3843 flagValues := map [string ]string {
3944 projectIdFlag : testProjectId ,
45+ regionFlag : testRegion ,
4046 networkIdFlag : testNetworkId ,
4147 }
4248 for _ , mod := range mods {
@@ -50,8 +56,9 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
5056 GlobalFlagModel : & globalflags.GlobalFlagModel {
5157 ProjectId : testProjectId ,
5258 Verbosity : globalflags .VerbosityDefault ,
59+ Region : testRegion ,
5360 },
54- NetworkId : utils . Ptr ( testNetworkId ) ,
61+ NetworkId : testNetworkId ,
5562 NicId : testNicId ,
5663 }
5764 for _ , mod := range mods {
@@ -61,7 +68,7 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
6168}
6269
6370func fixtureRequest (mods ... func (request * iaas.ApiDeleteNicRequest )) iaas.ApiDeleteNicRequest {
64- request := testClient .DeleteNic (testCtx , testProjectId , testNetworkId , testNicId )
71+ request := testClient .DeleteNic (testCtx , testProjectId , testRegion , testNetworkId , testNicId )
6572 for _ , mod := range mods {
6673 mod (& request )
6774 }
0 commit comments