@@ -64,6 +64,7 @@ func CreateFakeIAMManager(tt *TestTools) (*account.Project, *iam.APIKey, FakeSid
6464 iamPolicyName := sdkacctest .RandomWithPrefix ("test-acc-scaleway-iam-policy" )
6565
6666 projectAPI := account .NewProjectAPI (tt .Meta .ScwClient ())
67+
6768 project , err := projectAPI .CreateProject (& account.ProjectAPICreateProjectRequest {
6869 Name : projectName ,
6970 })
@@ -74,13 +75,15 @@ func CreateFakeIAMManager(tt *TestTools) (*account.Project, *iam.APIKey, FakeSid
7475
7576 return nil , nil , nil , err
7677 }
78+
7779 terminateFunctions = append (terminateFunctions , func () error {
7880 return projectAPI .DeleteProject (& account.ProjectAPIDeleteProjectRequest {
7981 ProjectID : project .ID ,
8082 })
8183 })
8284
8385 iamAPI := iam .NewAPI (tt .Meta .ScwClient ())
86+
8487 iamApplication , err := iamAPI .CreateApplication (& iam.CreateApplicationRequest {
8588 Name : iamApplicationName ,
8689 })
@@ -91,6 +94,7 @@ func CreateFakeIAMManager(tt *TestTools) (*account.Project, *iam.APIKey, FakeSid
9194
9295 return nil , nil , nil , err
9396 }
97+
9498 terminateFunctions = append (terminateFunctions , func () error {
9599 return iamAPI .DeleteApplication (& iam.DeleteApplicationRequest {
96100 ApplicationID : iamApplication .ID ,
@@ -114,6 +118,7 @@ func CreateFakeIAMManager(tt *TestTools) (*account.Project, *iam.APIKey, FakeSid
114118
115119 return nil , nil , nil , err
116120 }
121+
117122 terminateFunctions = append (terminateFunctions , func () error {
118123 return iamAPI .DeletePolicy (& iam.DeletePolicyRequest {
119124 PolicyID : iamPolicy .ID ,
@@ -131,6 +136,7 @@ func CreateFakeIAMManager(tt *TestTools) (*account.Project, *iam.APIKey, FakeSid
131136
132137 return nil , nil , nil , err
133138 }
139+
134140 terminateFunctions = append (terminateFunctions , func () error {
135141 return iamAPI .DeleteAPIKey (& iam.DeleteAPIKeyRequest {
136142 AccessKey : iamAPIKey .AccessKey ,
@@ -163,6 +169,7 @@ func CreateFakeSideProject(tt *TestTools) (*account.Project, *iam.APIKey, FakeSi
163169 iamPolicyName := sdkacctest .RandomWithPrefix ("test-acc-scaleway-iam-policy" )
164170
165171 projectAPI := account .NewProjectAPI (tt .Meta .ScwClient ())
172+
166173 project , err := projectAPI .CreateProject (& account.ProjectAPICreateProjectRequest {
167174 Name : projectName ,
168175 })
@@ -173,13 +180,15 @@ func CreateFakeSideProject(tt *TestTools) (*account.Project, *iam.APIKey, FakeSi
173180
174181 return nil , nil , nil , err
175182 }
183+
176184 terminateFunctions = append (terminateFunctions , func () error {
177185 return projectAPI .DeleteProject (& account.ProjectAPIDeleteProjectRequest {
178186 ProjectID : project .ID ,
179187 })
180188 })
181189
182190 iamAPI := iam .NewAPI (tt .Meta .ScwClient ())
191+
183192 iamApplication , err := iamAPI .CreateApplication (& iam.CreateApplicationRequest {
184193 Name : iamApplicationName ,
185194 })
@@ -190,6 +199,7 @@ func CreateFakeSideProject(tt *TestTools) (*account.Project, *iam.APIKey, FakeSi
190199
191200 return nil , nil , nil , err
192201 }
202+
193203 terminateFunctions = append (terminateFunctions , func () error {
194204 return iamAPI .DeleteApplication (& iam.DeleteApplicationRequest {
195205 ApplicationID : iamApplication .ID ,
@@ -213,6 +223,7 @@ func CreateFakeSideProject(tt *TestTools) (*account.Project, *iam.APIKey, FakeSi
213223
214224 return nil , nil , nil , err
215225 }
226+
216227 terminateFunctions = append (terminateFunctions , func () error {
217228 return iamAPI .DeletePolicy (& iam.DeletePolicyRequest {
218229 PolicyID : iamPolicy .ID ,
@@ -230,6 +241,7 @@ func CreateFakeSideProject(tt *TestTools) (*account.Project, *iam.APIKey, FakeSi
230241
231242 return nil , nil , nil , err
232243 }
244+
233245 terminateFunctions = append (terminateFunctions , func () error {
234246 return iamAPI .DeleteAPIKey (& iam.DeleteAPIKeyRequest {
235247 AccessKey : iamAPIKey .AccessKey ,
0 commit comments