blob: 336e2fe02d0772e662809a8df7afac7ee39cbdcb [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}