Joe Topjian | 520307e | 2015-02-07 05:22:12 +0000 | [diff] [blame] | 1 | package volumeattach |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | th "github.com/rackspace/gophercloud/testhelper" |
| 7 | "github.com/rackspace/gophercloud/testhelper/client" |
| 8 | ) |
| 9 | |
| 10 | func TestListURL(t *testing.T) { |
| 11 | th.SetupHTTP() |
| 12 | defer th.TeardownHTTP() |
| 13 | c := client.ServiceClient() |
| 14 | serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" |
| 15 | |
| 16 | th.CheckEquals(t, c.Endpoint+"servers/"+serverId+"/os-volume_attachments", listURL(c, serverId)) |
| 17 | } |
| 18 | |
| 19 | func TestCreateURL(t *testing.T) { |
| 20 | th.SetupHTTP() |
| 21 | defer th.TeardownHTTP() |
| 22 | c := client.ServiceClient() |
| 23 | serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" |
| 24 | |
| 25 | th.CheckEquals(t, c.Endpoint+"servers/"+serverId+"/os-volume_attachments", createURL(c, serverId)) |
| 26 | } |
| 27 | |
| 28 | func TestGetURL(t *testing.T) { |
| 29 | th.SetupHTTP() |
| 30 | defer th.TeardownHTTP() |
| 31 | c := client.ServiceClient() |
| 32 | serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" |
| 33 | aId := "a26887c6-c47b-4654-abb5-dfadf7d3f804" |
| 34 | |
| 35 | th.CheckEquals(t, c.Endpoint+"servers/"+serverId+"/os-volume_attachments/"+aId, getURL(c, serverId, aId)) |
| 36 | } |
| 37 | |
| 38 | func TestDeleteURL(t *testing.T) { |
| 39 | th.SetupHTTP() |
| 40 | defer th.TeardownHTTP() |
| 41 | c := client.ServiceClient() |
| 42 | serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" |
| 43 | aId := "a26887c6-c47b-4654-abb5-dfadf7d3f804" |
| 44 | |
| 45 | th.CheckEquals(t, c.Endpoint+"servers/"+serverId+"/os-volume_attachments/"+aId, deleteURL(c, serverId, aId)) |
| 46 | } |