Joe Topjian | c9fb21b | 2015-02-22 05:55:48 +0000 | [diff] [blame] | 1 | package servergroups |
| 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 | |
| 15 | th.CheckEquals(t, c.Endpoint+"os-server-groups", listURL(c)) |
| 16 | } |
| 17 | |
| 18 | func TestCreateURL(t *testing.T) { |
| 19 | th.SetupHTTP() |
| 20 | defer th.TeardownHTTP() |
| 21 | c := client.ServiceClient() |
| 22 | |
| 23 | th.CheckEquals(t, c.Endpoint+"os-server-groups", createURL(c)) |
| 24 | } |
| 25 | |
| 26 | func TestGetURL(t *testing.T) { |
| 27 | th.SetupHTTP() |
| 28 | defer th.TeardownHTTP() |
| 29 | c := client.ServiceClient() |
| 30 | id := "1" |
| 31 | |
| 32 | th.CheckEquals(t, c.Endpoint+"os-server-groups/"+id, getURL(c, id)) |
| 33 | } |
| 34 | |
| 35 | func TestDeleteURL(t *testing.T) { |
| 36 | th.SetupHTTP() |
| 37 | defer th.TeardownHTTP() |
| 38 | c := client.ServiceClient() |
| 39 | id := "1" |
| 40 | |
| 41 | th.CheckEquals(t, c.Endpoint+"os-server-groups/"+id, deleteURL(c, id)) |
| 42 | } |