github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/dli/v1/queues/testing/requests_test.go (about)

     1  package testing
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/huaweicloud/golangsdk/openstack/dli/v1/queues"
     7  	th "github.com/huaweicloud/golangsdk/testhelper"
     8  	"github.com/huaweicloud/golangsdk/testhelper/client"
     9  )
    10  
    11  func TestList(t *testing.T) {
    12  	th.SetupHTTP()
    13  	defer th.TeardownHTTP()
    14  	handleList(t)
    15  
    16  	listResult := queues.List(client.ServiceClient(), queues.ListOpts{})
    17  	th.AssertNoErr(t, listResult.Err)
    18  	rt := listResult.Body.(*queues.ListResult)
    19  	th.AssertDeepEquals(t, expectedListResponseData, rt.Queues[0])
    20  }
    21  
    22  func TestScale(t *testing.T) {
    23  	th.SetupHTTP()
    24  	defer th.TeardownHTTP()
    25  
    26  	handleScale(t)
    27  
    28  	result := queues.ScaleOrRestart(client.ServiceClient(), queues.ActionOpts{
    29  		Action:    "scale_out",
    30  		CuCount:   16,
    31  		QueueName: queueName1,
    32  	})
    33  
    34  	th.AssertNoErr(t, result.Err)
    35  }