blob: b04b4321dffff34ab59c96bf69f064ee5b58c568 [file] [log] [blame]
Jamie Hannaford89f9af22014-09-17 12:21:48 +02001package subnets
Jamie Hannaford0708c002014-09-17 16:08:49 +02002
3import (
4 "testing"
5
6 "github.com/rackspace/gophercloud"
7 th "github.com/rackspace/gophercloud/testhelper"
8)
9
Jamie Hannaford686c4962014-09-23 10:46:20 +020010const endpoint = "http://localhost:57909/"
Jamie Hannaford0708c002014-09-17 16:08:49 +020011
Jamie Hannaford686c4962014-09-23 10:46:20 +020012func endpointClient() *gophercloud.ServiceClient {
13 return &gophercloud.ServiceClient{Endpoint: endpoint}
Jamie Hannaford0708c002014-09-17 16:08:49 +020014}
15
16func TestListURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020017 actual := listURL(endpointClient())
18 expected := endpoint + "v2.0/subnets"
Jamie Hannaford0708c002014-09-17 16:08:49 +020019 th.AssertEquals(t, expected, actual)
20}
21
22func TestGetURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020023 actual := getURL(endpointClient(), "foo")
24 expected := endpoint + "v2.0/subnets/foo"
Jamie Hannaford0708c002014-09-17 16:08:49 +020025 th.AssertEquals(t, expected, actual)
26}
Jamie Hannaford63631432014-09-18 11:40:09 +020027
28func TestCreateURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020029 actual := createURL(endpointClient())
30 expected := endpoint + "v2.0/subnets"
Jamie Hannaford63631432014-09-18 11:40:09 +020031 th.AssertEquals(t, expected, actual)
32}
Jamie Hannafordd11e20c2014-09-18 12:03:01 +020033
34func TestUpdateURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020035 actual := updateURL(endpointClient(), "foo")
36 expected := endpoint + "v2.0/subnets/foo"
Jamie Hannafordd11e20c2014-09-18 12:03:01 +020037 th.AssertEquals(t, expected, actual)
38}
39
40func TestDeleteURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020041 actual := deleteURL(endpointClient(), "foo")
42 expected := endpoint + "v2.0/subnets/foo"
Jamie Hannafordd11e20c2014-09-18 12:03:01 +020043 th.AssertEquals(t, expected, actual)
44}