@@ -11,11 +11,8 @@ import (
11
11
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
12
12
svctcr "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/tcr"
13
13
14
- "github.com/stretchr/testify/assert"
15
14
tcr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcr/v20190924"
16
15
17
- "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
18
-
19
16
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
20
17
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
21
18
)
@@ -303,101 +300,6 @@ func TestAccTencentCloudTcrInstanceResource_replication_regionName(t *testing.T)
303
300
},
304
301
})
305
302
}
306
- func TestAccTencentCloudTcrInstanceResource_replica_set (t * testing.T ) {
307
- inputs := []interface {}{
308
- map [string ]interface {}{
309
- "region_id" : 1 ,
310
- "sync_cos" : true ,
311
- },
312
- map [string ]interface {}{
313
- "region_id" : 2 ,
314
- },
315
- map [string ]interface {}{
316
- "region_id" : 3 ,
317
- "sync_cos" : false ,
318
- },
319
- }
320
-
321
- registries1 := []* tcr.ReplicationRegistry {
322
- {
323
- ReplicationRegistryId : helper .String ("a" ),
324
- RegistryId : helper .String ("x" ),
325
- ReplicationRegionId : helper .IntUint64 (1 ),
326
- },
327
- {
328
- ReplicationRegistryId : helper .String ("b" ),
329
- RegistryId : helper .String ("x" ),
330
- ReplicationRegionId : helper .IntUint64 (2 ),
331
- },
332
- {
333
- ReplicationRegistryId : helper .String ("c" ),
334
- RegistryId : helper .String ("x" ),
335
- ReplicationRegionId : helper .IntUint64 (3 ),
336
- },
337
- }
338
-
339
- result1 := svctcr .ResourceTencentCloudTcrFillReplicas (inputs , registries1 )
340
- expected1 := []interface {}{
341
- map [string ]interface {}{
342
- "id" : "a" ,
343
- "region_id" : 1 ,
344
- "sync_cos" : true ,
345
- },
346
- map [string ]interface {}{
347
- "id" : "b" ,
348
- "region_id" : 2 ,
349
- },
350
- map [string ]interface {}{
351
- "id" : "c" ,
352
- "region_id" : 3 ,
353
- "sync_cos" : false ,
354
- },
355
- }
356
- assert .Equalf (t , expected1 , result1 , "%s case 1 not equal, expected:\n %v\n got: \n %v" , t .Name (), expected1 , result1 )
357
-
358
- var registries2 []* tcr.ReplicationRegistry
359
- registries2Incr := []* tcr.ReplicationRegistry {
360
- {
361
- ReplicationRegistryId : helper .String ("d" ),
362
- RegistryId : helper .String ("x" ),
363
- ReplicationRegionId : helper .IntUint64 (4 ),
364
- },
365
- {
366
- ReplicationRegistryId : helper .String ("e" ),
367
- RegistryId : helper .String ("x" ),
368
- ReplicationRegionId : helper .IntUint64 (5 ),
369
- },
370
- }
371
- registries2 = append (registries2 , registries1 ... )
372
- registries2 = append (registries2 , registries2Incr ... )
373
- result2 := svctcr .ResourceTencentCloudTcrFillReplicas (inputs , registries2 )
374
- expected2 := []interface {}{
375
- map [string ]interface {}{
376
- "id" : "a" ,
377
- "region_id" : 1 ,
378
- "sync_cos" : true ,
379
- },
380
- map [string ]interface {}{
381
- "id" : "b" ,
382
- "region_id" : 2 ,
383
- },
384
- map [string ]interface {}{
385
- "id" : "c" ,
386
- "region_id" : 3 ,
387
- "sync_cos" : false ,
388
- },
389
- map [string ]interface {}{
390
- "id" : "d" ,
391
- "region_id" : 4 ,
392
- },
393
- map [string ]interface {}{
394
- "id" : "e" ,
395
- "region_id" : 5 ,
396
- },
397
- }
398
-
399
- assert .Equalf (t , expected2 , result2 , "%s case 2 not equal, expected:\n %v\n got: \n %v" , t .Name (), expected2 , result2 )
400
- }
401
303
402
304
func testAccCheckTCRInstanceDestroy (s * terraform.State ) error {
403
305
logId := tccommon .GetLogId (tccommon .ContextNil )
0 commit comments