blob: eec527565d97c832581487ee6b11782a2d153e81 [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
10const Endpoint = "http://localhost:57909/"
11
12func EndpointClient() *gophercloud.ServiceClient {
13 return &gophercloud.ServiceClient{Endpoint: Endpoint}
14}
15
16func TestListURL(t *testing.T) {
17 actual := ListURL(EndpointClient())
18 expected := Endpoint + "v2.0/subnets"
19 th.AssertEquals(t, expected, actual)
20}
21
22func TestGetURL(t *testing.T) {
23 actual := GetURL(EndpointClient(), "foo")
24 expected := Endpoint + "v2.0/subnets/foo"
25 th.AssertEquals(t, expected, actual)
26}
Jamie Hannaford63631432014-09-18 11:40:09 +020027
28func TestCreateURL(t *testing.T) {
29 actual := CreateURL(EndpointClient())
30 expected := Endpoint + "v2.0/subnets"
31 th.AssertEquals(t, expected, actual)
32}
Jamie Hannafordd11e20c2014-09-18 12:03:01 +020033
34func TestUpdateURL(t *testing.T) {
35 actual := UpdateURL(EndpointClient(), "foo")
36 expected := Endpoint + "v2.0/subnets/foo"
37 th.AssertEquals(t, expected, actual)
38}
39
40func TestDeleteURL(t *testing.T) {
41 actual := DeleteURL(EndpointClient(), "foo")
42 expected := Endpoint + "v2.0/subnets/foo"
43 th.AssertEquals(t, expected, actual)
44}