blob: f73d6fb0f9fe43a6cfd817fba5020815db551900 [file] [log] [blame]
Joe Topjiandee32222015-02-09 23:56:26 +00001package floatingip
2
3import (
4 "testing"
5
6 th "github.com/rackspace/gophercloud/testhelper"
7 "github.com/rackspace/gophercloud/testhelper/client"
8)
9
10func TestListURL(t *testing.T) {
11 th.SetupHTTP()
12 defer th.TeardownHTTP()
13 c := client.ServiceClient()
14
15 th.CheckEquals(t, c.Endpoint+"os-floating-ips", listURL(c))
16}
17
18func TestCreateURL(t *testing.T) {
19 th.SetupHTTP()
20 defer th.TeardownHTTP()
21 c := client.ServiceClient()
22
23 th.CheckEquals(t, c.Endpoint+"os-floating-ips", createURL(c))
24}
25
26func 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-floating-ips/"+id, getURL(c, id))
33}
34
35func 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-floating-ips/"+id, deleteURL(c, id))
42}
43
44func TestAssociateURL(t *testing.T) {
45 th.SetupHTTP()
46 defer th.TeardownHTTP()
47 c := client.ServiceClient()
48 serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0"
49
50 th.CheckEquals(t, c.Endpoint+"servers/"+serverId+"/action", associateURL(c, serverId))
51}
52
53func TestDisassociateURL(t *testing.T) {
54 th.SetupHTTP()
55 defer th.TeardownHTTP()
56 c := client.ServiceClient()
57 serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0"
58
59 th.CheckEquals(t, c.Endpoint+"servers/"+serverId+"/action", disassociateURL(c, serverId))
60}