Skip to content

Commit 523645c

Browse files
committed
feat(tcr): doc
1 parent b407d96 commit 523645c

File tree

1 file changed

+0
-98
lines changed

1 file changed

+0
-98
lines changed

tencentcloud/services/tcr/resource_tc_tcr_instance_test.go

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ import (
1111
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
1212
svctcr "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/tcr"
1313

14-
"github.com/stretchr/testify/assert"
1514
tcr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcr/v20190924"
1615

17-
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
18-
1916
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
2017
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
2118
)
@@ -303,101 +300,6 @@ func TestAccTencentCloudTcrInstanceResource_replication_regionName(t *testing.T)
303300
},
304301
})
305302
}
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\ngot: \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\ngot: \n%v", t.Name(), expected2, result2)
400-
}
401303

402304
func testAccCheckTCRInstanceDestroy(s *terraform.State) error {
403305
logId := tccommon.GetLogId(tccommon.ContextNil)

0 commit comments

Comments
 (0)