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