blob: ba1515f58857bc3f906532c97ab91659b83b7e38 [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 {
Jamie Hannaford4e98b872014-10-06 15:27:19 +020013<<<<<<< HEAD
Ash Wilsonb4c8c6f2014-10-06 17:35:02 -040014 return &gophercloud.ServiceClient{Endpoint: endpoint, ResourceBase: endpoint + "v2.0/"}
Jamie Hannaford4e98b872014-10-06 15:27:19 +020015=======
16 return &gophercloud.ServiceClient{Endpoint: endpoint}
17>>>>>>> Renaming erroneous test files
Jamie Hannaford0708c002014-09-17 16:08:49 +020018}
19
20func TestListURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020021 actual := listURL(endpointClient())
22 expected := endpoint + "v2.0/subnets"
Jamie Hannaford0708c002014-09-17 16:08:49 +020023 th.AssertEquals(t, expected, actual)
24}
25
26func TestGetURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020027 actual := getURL(endpointClient(), "foo")
28 expected := endpoint + "v2.0/subnets/foo"
Jamie Hannaford0708c002014-09-17 16:08:49 +020029 th.AssertEquals(t, expected, actual)
30}
Jamie Hannaford63631432014-09-18 11:40:09 +020031
32func TestCreateURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020033 actual := createURL(endpointClient())
34 expected := endpoint + "v2.0/subnets"
Jamie Hannaford63631432014-09-18 11:40:09 +020035 th.AssertEquals(t, expected, actual)
36}
Jamie Hannafordd11e20c2014-09-18 12:03:01 +020037
38func TestUpdateURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020039 actual := updateURL(endpointClient(), "foo")
40 expected := endpoint + "v2.0/subnets/foo"
Jamie Hannafordd11e20c2014-09-18 12:03:01 +020041 th.AssertEquals(t, expected, actual)
42}
43
44func TestDeleteURL(t *testing.T) {
Jamie Hannaford686c4962014-09-23 10:46:20 +020045 actual := deleteURL(endpointClient(), "foo")
46 expected := endpoint + "v2.0/subnets/foo"
Jamie Hannafordd11e20c2014-09-18 12:03:01 +020047 th.AssertEquals(t, expected, actual)
48}