@@ -9,6 +9,38 @@ import (
99 "github.com/hashicorp/terraform-plugin-sdk/terraform"
1010)
1111
12+ func init () {
13+ // go test -v ./tencentcloud -sweep=ap-guangzhou -sweep-run=tencentcloud_vod_procedure_template
14+ resource .AddTestSweepers ("tencentcloud_vod_procedure_template" , & resource.Sweeper {
15+ Name : "tencentcloud_vod_procedure_template" ,
16+ F : func (r string ) error {
17+ logId := getLogId (contextNil )
18+ ctx := context .WithValue (context .TODO (), logIdKey , logId )
19+ sharedClient , err := sharedClientForRegion (r )
20+ if err != nil {
21+ return fmt .Errorf ("getting tencentcloud client error: %s" , err .Error ())
22+ }
23+ client := sharedClient .(* TencentCloudClient )
24+ vodService := VodService {
25+ client : client .apiV3Conn ,
26+ }
27+ filter := make (map [string ]interface {})
28+ templates , err := vodService .DescribeProcedureTemplatesByFilter (ctx , filter )
29+ if err != nil {
30+ return err
31+ }
32+ for _ , template := range templates {
33+ ee := vodService .DeleteProcedureTemplate (ctx , * template .Name , uint64 (0 ))
34+ if ee != nil {
35+ continue
36+ }
37+ }
38+
39+ return nil
40+ },
41+ })
42+ }
43+
1244func TestAccTencentCloudVodProcedureTemplateResource (t * testing.T ) {
1345 t .Parallel ()
1446 resource .Test (t , resource.TestCase {
0 commit comments