1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
package startstop
import (
"testing"
th "github.com/rackspace/gophercloud/testhelper"
"github.com/rackspace/gophercloud/testhelper/client"
)
const serverID = "{serverId}"
func TestStart(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
mockStartServerResponse(t, serverID)
err := Start(client.ServiceClient(), serverID).ExtractErr()
th.AssertNoErr(t, err)
}
func TestStop(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
mockStopServerResponse(t, serverID)
err := Stop(client.ServiceClient(), serverID).ExtractErr()
th.AssertNoErr(t, err)
}
|