github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/compute/v2/extensions/suspendresume/testing/requests_test.go (about) 1 package testing 2 3 import ( 4 "testing" 5 6 "github.com/huaweicloud/golangsdk/openstack/compute/v2/extensions/suspendresume" 7 th "github.com/huaweicloud/golangsdk/testhelper" 8 "github.com/huaweicloud/golangsdk/testhelper/client" 9 ) 10 11 const serverID = "{serverId}" 12 13 func TestSuspend(t *testing.T) { 14 th.SetupHTTP() 15 defer th.TeardownHTTP() 16 17 mockSuspendServerResponse(t, serverID) 18 19 err := suspendresume.Suspend(client.ServiceClient(), serverID).ExtractErr() 20 th.AssertNoErr(t, err) 21 } 22 23 func TestResume(t *testing.T) { 24 th.SetupHTTP() 25 defer th.TeardownHTTP() 26 27 mockResumeServerResponse(t, serverID) 28 29 err := suspendresume.Resume(client.ServiceClient(), serverID).ExtractErr() 30 th.AssertNoErr(t, err) 31 }